The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
313 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 ...
0
votes
0answers
12 views

Wordpress select adding an extra post

I have this script that is supposed to pull all of the posts with the same category id as the page titles name. So if the page titles name is "non-profit" it pulls all the posts with the category ...
0
votes
0answers
16 views

In edit post show categories as select instead of checkboxes

In wp-admin edit post categories(taxonomies) are listed as checkboxes. People can select multiple categories. That is exactly what I don't want! I want the categories to be listed as an ...
0
votes
1answer
41 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
2answers
63 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
16 views

How To Show/Hide WordPress Meta Boxes Fields According to Option Select

I have a select list with values hosts and html5 and 3 custom fields. On select with value hosts 2 fields (Youtube and Vimeo) should appear, and if value is html5 the remain (Embed) should appear. ...
0
votes
1answer
31 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 ...
2
votes
1answer
367 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
31 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
133 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
47 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
26 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 ...
0
votes
1answer
101 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
95 views

how to capture the value of the selected parent category

I am very new to WordPress as well as coding and I am stuck with one of the form field, which has a select box for listing all categories and sub-categories (taxonomies) in it. But I would like a ...
0
votes
0answers
4k 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
0answers
61 views

Simple WP Plugin with plugin settings page

I need to create a plugin with only one select on his settings page and save select value. I have a select with all register menus and I can not to save my select value. What am I doing wrong? What ...
0
votes
1answer
78 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 ...
0
votes
0answers
21 views

Form with select multiple

I am looking to do a taxonomy list with multiple choice. In the same way: <select class="" tabindex="-1" multiple="" data-placeholder="Check the ingredients"> <option ...
0
votes
1answer
1k 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 ...
0
votes
1answer
245 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
142 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
328 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
157 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
46 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 ...
0
votes
0answers
58 views

Custom Post Type Meta Select Box Get URL for Roya Slider

I'am using a snippet i got from here: Populating meta box with select-list of existing posts, and assigning it to custom post types Mikes Code works great and does what i want: Display a MetaBox at ...
-3
votes
1answer
115 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 ...
0
votes
1answer
252 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
1k 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
83 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
81 views

Wordpress plugin, listing posts in admin and having correct title/selected value

I'm making a plugin that is used to display a single post in a widget area. I can get the front end working just fine, but in the Admin area (Widgets page and customizer) I'm having some issues. I ...
0
votes
0answers
95 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 ...
0
votes
0answers
33 views

Get the parameter, compare it in the array, check and display

I have: Wordpress custom post types; Two hotels registered in the custom Wordpress admin area; A variable named $hotels which get the field where the hotels registered are listed; The hotels are ...
0
votes
0answers
32 views

Get parently level taxonomy based on published posts that have child taxonomy?

I have a CPT Properties and a taxonomy Regions. So a Region is something like: Florida South Gulf Coast Anne Marie Islands Cape Coral Generally only the third level will ever be selected in a ...
2
votes
1answer
234 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
votes
3answers
5k views

Woocommerce: Changing the variations select default value? [closed]

At my site i want to change the default value of the selecter that appears, when different variations exists. If anyone can give me a clue of how and where this is done, it would be highly ...
0
votes
0answers
323 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
227 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 ...
0
votes
2answers
3k views

Get selected value with PHP and jQuery

I have form that i'm using to update user profile from front end and i have country select. <form method="post" id="adduser" action="<?php the_permalink(); ?>"> <select id="te" ...
0
votes
2answers
657 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 ...
1
vote
2answers
697 views

Make Selected Mutiselect Items “selected”

I'm developing a theme settings panel for a new wordpress theme that have an option to exclude categories from being shown in the loop. I managed to get the main functionality to work, using a ...
0
votes
1answer
161 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 ...
0
votes
1answer
121 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 ...
0
votes
0answers
442 views

WP Query multiple select form - meta_query help

I am creating a multiple filter - as in I could filter by all the options if I wanted to do so, i.e terms, calories & price in my case. I am having trouble with meta query args. At present I can ...
0
votes
1answer
803 views

wp_dropdown_pages auto submit

What I have below currently works fine except for one issue: When a select item is chosen, it will correctly go to the subpage - however, if on a sub-page of the main site already, and a item is ...
0
votes
1answer
88 views

Help me SELECT thumbnail from SQL and use

//MySQL Username $user = "myuser"; //MySQL Password $pass = "mypass"; //MySQL Database Name $database = "mydb"; //Number of posts you want to have appear $numOfPosts = 7; //Setup connection $mysqli = ...
2
votes
2answers
4k 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 ...
1
vote
1answer
183 views

Retain select value in select box

How are you all. I am just struggling to make my custom select box keep retain select value in form when page is reload or user come on form via different navigation. my select box is: <?php ...
0
votes
1answer
503 views

Widget select option not saving

I do this widget but the selected options dont saving when updated. This is the code: /* CUSTOM POSTS LIST */ class Posts_list extends WP_Widget { function Posts_list() { /* Widget ...
0
votes
1answer
443 views

Select post from dropdown and add query args not working

The behavior of the below should be that the user makes a selection on the dropdown box and the page refreshes with a query arg of editevent=1 and also passes a value of the post ID with the selection ...
2
votes
1answer
188 views

Listing all capabilities in dropdown is returning boolean

Trying to put a list of all possible caps in a dropdown. I can only get it to return 1s (boolean true). If I use var_dump($user->allcaps); it does produce the actual cap names, but when I plug this ...