The tag has no usage guidance.

learn more… | top users | synonyms

-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">...
-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: "...
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 ...
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
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
170 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
74 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 ...
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");...
0
votes
1answer
544 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
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
563 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;...
0
votes
2answers
539 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 ...
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
1answer
258 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
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
915 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__ ), '...
-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 ) { ...
0
votes
0answers
214 views

Add SELECT in search form

I'm trying to change the searchform adding select tags. In my theme, if I search "a b c", the search result in the URL is "/?s=a+b+c", but with the new form I am not able to print the sum. This is ...
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 ...
2
votes
1answer
620 views

wp_dropdown_pages default value

I have a dropdown menu of pages, but after I go to a page selected, let's say "About us", the default title button of dropbown is the title of the page, "About us", so i want the title/default option ...
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="...
0
votes
0answers
518 views

wordpress option page data from select form is not saving to database

I am going to create a wordpress plugin with a option page and I have created a two page called index.php and options.php and in index.php I have written the following code to create default options ...
0
votes
0answers
343 views

select to search in category AND custom post type

I try to do something but which I block. What I need is simple: a search textbox and a select which allows the user to search either in whole or in custom post types, or in category. Separately, I can ...
1
vote
2answers
2k views

How to deal with multiple select options using register_setting() theme options

I'm using Ian Stewart's Sample Theme Options for a lightweight Theme Options panel. INSERTION FAILED I need to insert Multiple categories into db, where I used the following code: <select ...
0
votes
1answer
331 views

wpdb select from using array as search parameters

Similar to how you can insert into an array using code such as $wpdb->insert( $table_name, $inputs); //where inputs is an array I want to do a sql select statement with code such as $wpdb->...
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
159 views

Get post title by Alphabet

I try to call this function to get a list of posts by alphabet. But for some reason i keep getting an error. Call to a member function get_col() on a non-object. What am i doing wrong? {function ...