The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
1answer
601 views

Multiple options not staying selected after saving

Problems: The save works, but is only storing one of the options in the database after save. Options not showing as selected after save. The select fields: <select id="...
-3
votes
0answers
18 views

Skip passing value in form

Is it possible to skip passing value in form if user doesn't choose something and default value "Choose your color" is selected? <select name="something"> <option selected="selected">...
0
votes
1answer
446 views

Compare current post Category in select menu

I have done this many times but not via a form so i am getting a weird issues when trying to assign a "selected" based on the current post term id... Maybe the use of _the_category and then ...
-1
votes
0answers
9 views

How do I create a select box that, upon selecting a value, will display information pertaining to that value?

I have been searching for an answer to this to no avail. I can make it work with some jquery on a normal HTML page, but not a wordpress page. A good example of what I need is expressed in this ...
0
votes
2answers
23 views

Display posts by combining multiple meta key

Basically a post is an event therefor will be displayed once or twice, depending on meta key. Every post has at least two meta keys $start_time_1 and $end_time_1. Let's say i have two posts, title: "...
0
votes
2answers
540 views

Select box saves but doesn't update value in admin

I have a select dropdown in my custom meta box in the admin area. It offers two options Approved and In Progress. When I select an option and save it the database is updated, but the value in the ...
2
votes
0answers
21 views

Select menu should display categories and the item's depth

I have a select menu of a custom post type in the header.php: <?php $selectloop = new WP_Query( array( 'post_type' => 'products', 'posts_per_page' => -1 ) ); echo '<form>&...
0
votes
1answer
26 views

Can I limit term selection to one plus parent?

So i have a custom post type (listings) and a custom taxonomy (listing_terms). The taxonomy has parent/child terms. Eg: Restaurant -> Cafe (where Cafe is the child of Restaurant). I want to only let ...
18
votes
3answers
29k views

How to use wp_nav_menu to create a select menu dropdown?

I'm using the following inside the wp_nav_menu function to create a select dropdown menu where each menu item is an option in the select dropdown... 'items_wrap' => '<select>%3$s</select&...
0
votes
0answers
54 views

Marking Multiple Options Selected in Different Select Boxes

I've added a multi select box to each menu item on the Menus page. How can I mark multiple items as selected for a given select box? <script type="text/javascript"> jQuery(document).ready(...
1
vote
0answers
8 views

Selecting and outputting results from DB with an array

I have always had issues with arrays. I can never seem to get them to work correctly. Could someone advise me. I want to make a selection from the database, use that in another selection and then ...
-1
votes
1answer
24 views

Tool to check the database in Production [closed]

I Would like to use a tool to execute SELECT requests on the PRODUCTION database. This tool must be full security because my site is deployed on Internet. Any idea ? Regards
2
votes
2answers
6k views

Populating meta box with select-list of existing posts, and assigning it to custom post types

My question is partly based on this answer: http://wordpress.stackexchange.com/a/5778/27135 Mike's answer is really great, and the solution worked fine until I needed to include my meta box in a ...
0
votes
0answers
64 views

SQL in WordPress get_var() not working

I created a few tables in my main WordPress database. Table names are: cards scards I put a plugin that lets me use PHP in pages, I used it in my other WordPress sites successfully but in this ...
0
votes
1answer
53 views

Populating dropdown menu with hierarchical taxonomies

Im currently populating my <select> elements (I've got plenty of them) with nested foreach loops, get_terms() and &nbsp;&nbsp;&nbsp;&nbsp; to create padding for each nested child ...
1
vote
1answer
157 views

How to number the options in a wp_dropdown_pages() select?

I'm using wp_dropdown_pages() but would like to number the options returned for the user. So instead of something like... <option value='http://someurl'>item one</option> <option ...
0
votes
0answers
21 views

Get options from a select custom field

I've created a select custom field with different predefined values. I've done this using the Types extension for WordPress. Now I'd like to create a function to retrieve all the values that this ...
0
votes
2answers
171 views

$wpdb-prepare : Do I have to bind a parameter to the table name?

I only do a SELECT on a whole table - and the table is defined in a variable: $table = $wpdb->prefix . 'members'; Do I have to bind a parameter to this variable? This caused an error: $result =...
0
votes
1answer
113 views

SELECT query with prepare and placeholder for string

I am trying to learn how to do a simple Select query using $wpdb-prepare. I am checking wether an email submitted by the user is already available in the database. There has to be something wrong ...
0
votes
2answers
286 views

Display tags from specific category in select fields

I am looking to display all tags in select form that are from posts that have been assigned to a specific category. I am using the following code to generate every tag in a select form <div> &...
0
votes
0answers
47 views

Select fields on a settings page

I'm trying to do it in the style of 'Example #2' on this page: https://codex.wordpress.org/Creating_Options_Pages as it seems the tidiest way I have come across to do it. The problem is I want to ...
0
votes
1answer
75 views

Adding option values as an array using a multi selectable select box

I have a plugin I'm developing. As part of its functionality I need to set up an option group and specify an option var for that group: function swcs_settings() { register_setting( 'swcs-settings-...
0
votes
0answers
78 views

Correct way to create a select list in one metabox of custom-post-type

I'm trying to make a custom one from dropbox type within another custom type with popular and use the information but after that the post that estpu working to change the type of this type in the ...
2
votes
2answers
5k views

Custom widget using get_categories select menu dropdown

I have created a custom widget that is supposed to display a select menu with all the categories the blog has. I have used get_categories to compile the list. This works fine and all categories appear ...
0
votes
1answer
39 views

Add category selection to function request

Got the following in my functions file, which is designed to query the last three posts published, however I want to limit it by a certain category. I was looking at adding is_category to the WHERE ...
0
votes
1answer
545 views

Custom select query two tables by a meta key

I'm using an event plugin which creates wp_ftcalendar_events table in database with start_datetime column. Here's image of whole table: I want to query my posts by start_datetime. I know that I can'...
0
votes
1answer
125 views

Custom Select Query pagination not working properly

I have Custom Select Query joining two tables and displaying events older than current date. Everything works fine until I try to paginate it. <?php global $wpdb; $date = date("Y-m-d");...
1
vote
2answers
4k views

How to Query Database for posts with certain Taxonomy Term

I want to write a select query to return data on only posts which have are associated with the taxonomy term food-and-beverage SELECT wp_postmeta . * , wp_posts.post_name FROM wp_posts, wp_postmeta, ...
0
votes
1answer
564 views

Making jQuery .change() event persistent after widget save

I'm creating a custom widget that uses a select element with a bunch of options and a simple jQuery function to trigger the visibility for some <div>s below it based on the selection, through a ...
0
votes
1answer
232 views

Select query for a login

I'm trying to make a login form, but select query isn't working. Is there another syntax in WordPress and in which way is password hashed? My code is: if ( isset( $_POST['submit'] ) ) { if ( !$...
0
votes
1answer
73 views

Read post meta values, only if posts are public

I want to retrieve meta_values applied to posts. Currently I execute the following query global $wpdb; $table = $wpdb->prefix.'postmeta'; $values = $wpdb->get_results( "SELECT meta_value ...
0
votes
1answer
105 views

Selecting NULL value from the database

I have a database with columns that are allowed to be NULL. Whenever I run a query against this database using $wpdb->get_results the columns that are NULL are always returned with an actual value;...
2
votes
1answer
529 views

How to make checkboxes from taxonomy terms?

I can populate selectbox options like this: <?php $args = array( 'taxonomy' => array( 'country', ), 'hide_empty' => 0, ...
0
votes
0answers
199 views

Using $wpdb->get_results with Select and a comparing a column with a variable

I wasn't sure whether I should ask this on stackoverflow so I thought I'd try here instead. I'm developing a custom plugin and I've got to retrieve some numbers from a table where the value in the ...
0
votes
0answers
233 views

Ajax Form data is not posted back to the get_results()

I am trying to run a wordpress wpdb->get_results select query and I want to get the search criteria from a textbox. I want to do it form and with ajax without refreshing the page. No matter what I do ...
0
votes
1answer
113 views

Ajax Query returns zero

I am doing simple wordpress select query and want to do this with ajax jquery and do not want the page to refresh when I press search button and writing text in search textbox. As soon as I press ...
0
votes
0answers
36 views

Cannot save select multiple option in my plugin options

I have a select element in my plugin option page, but can't figure out how to save it correctly (all other options are correctly saved and reused). public function ce_blog_chief_editor_callback(...
0
votes
1answer
248 views

Custom Taxonomy Select Menu: Setting default option value?

I'm creating a series of select drop down menus that pull data from various taxonomies. I got this PHP script working for a WooCommerce attribute of color: function get_color_dropdown($taxonomies, $...
0
votes
0answers
6k views

AJAX with Selectbox Plugins (Select2, Chosen, Selectize)

I have been searching all over the internet for tutorials on implementing AJAX actions from jQuery selectbox plugins such as Select2 , Selectize and Chosen. (these plugins look better than the inbuilt ...
0
votes
1answer
259 views

Trouble creating custom sanitization function for user list dropdown

I'm trying to create a custom author info box on homepage which will automaically generate by getting the info from user profile when a user is selected from theme customizer. I followed the code ...
1
vote
1answer
3k views

Replacing select2 in admin backend for all selects

I originally posted this question as a javascript question here, but think maybe it would be better asked here. I tried adding select2 to all wordpress admin screens. However, since many selects are ...
1
vote
1answer
1k views

Select data from database and list it in Loop (Wordpress)

your Answear helped me but i stuck again. here is what i have done now : <?PHP define( 'WP_USE_THEMES', false ); get_header(); global $wpdb; $sql = "SELECT vehicle_id, manufacturer, series, ...
0
votes
0answers
916 views

Get results from wordpress data custom table

Firstly i created a custom table into the wpdb : global $wpdb; $table_name = $wpdb->prefix . 'countdown_table'; $sql = ' `id` int(11) NOT NULL AUTO_INCREMENT, `styleName` varchar(255) ...
0
votes
1answer
2k views

Using a multiple <select> element in widget form

I am trying to save all of the options in a <select> element in a widget. So far I have the following PHP code for the form: public function form( $instance ) { // Code for editing/adding ...
1
vote
2answers
559 views

how to save selection meta data in user profile on frontend

Hi can anyone help me to save the post title selected in this select box? I would like to let people select posts out of a dropdown select box and save the value to their profile. Help is very ...
0
votes
1answer
111 views

Widget & storing a Select box choice

I am creating a simple widget which displays all of the pages on the website. The trouble I am having is how to store the user's choice and display it on the front end. At the moment, when saving my ...
-3
votes
1answer
207 views

dropdown does not work [closed]

I have the page http://www.supersprox.eu/invoicewithtabs/. When I click "Show filter" button an area with several dropdowns appear. The problem is I can not select values of the first row of dropdowns....
0
votes
1answer
502 views

Can't save drop down select date in meta boxes

I want to update my select options(drop down) but i don't know where i made a mistake.Here is my code. <?php function display_post_options(){ wp_nonce_field( basename( __FILE__ ), '...
3
votes
1answer
2k views

Get all posts from custom post type and insert in select input as metabox

I would like to know if its possible to do something like this. I have Slider custom post type and Services custom post type. For slider posts I have created a metabox for URL value to display next ...
-1
votes
1answer
117 views

Issues on saving data from CPT select metabox

I can't save data from a select metabox. My code is http://pastebin.com/BMmKzti2 Where I'm going wrong? Edit: Here is my code function fichasvtmbasicas_meta_box_callback( $post ) { ...