Questions tagged [select]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
9 views

Modify output of wp_dropdown_categories to add term IDs to each option

I've been searching for documentation or examples on how to modify the output of wp_dropdown_categories so I can add the term ID to each option. Is this possible? If not, my only thought would be to ...
0
votes
0answers
16 views

How do I create a dropdown menu for the title of a new page?

I am trying to write my own custom WP Theme for a fitness organization. When admins create a new certification, the title of the event will always be from the following: 1. Kickboxing Certification ...
0
votes
0answers
14 views

Multi select plugin options: Only one value is saved [duplicate]

At the moment I'm stuck with a multi select option for my plugin. I took one of my working select callbacks and added multiple="multiple" to it. Doesen't matter what I'm selecting only the option ...
0
votes
1answer
880 views

How to Display image from Menu Image in Walker Dropdown Select Menu

Created a custom menu list, titled Country that has flags representing countries (only Canada and USA) using the plugin Menu Image I combined this menu with Walker, to create a dropdown. I however ...
1
vote
1answer
572 views

How to make drop down post title

I am developing a website using WP CMS where I want to implement post title as drop-down list as well as when users select a drop-down title the content show below within reload. I am here. What will ...
0
votes
1answer
15 views

Can't add Select2 to select in variable product (admin)

I'm trying to add select2 to an input in WooCommerce variable product admin. I've added select2 to a class so it can be reused, however, it seems it's not working. It's working anywhere else on the ...
1
vote
2answers
21 views

WordPress setting with select - where is my mistake?

I have two option callbacks in my plugin, one with a ckeckbox and one with a select field. The first one is working perfectly, the second not. The select field doesn't save its value. I double checked ...
1
vote
1answer
451 views

Custom Meta Box (SELECT) Not Saving

I am trying to create a meta box with select options for each page with home-page-template.php assigned to it. I have got that functionality working correctly. I also want it above the editor, below ...
0
votes
1answer
32 views

How to populate a select field with post titles/ids in a block

I need to build a really simple block with just one select field. This select field should be populated with the titles/ids of posts of a specific post type. Once a user selects one post from this ...
0
votes
1answer
456 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
0answers
13 views

Media selection and multiple rows with jquery?

I need to make a WP plugin that would have: A WP-Admin page for doing stuff. In this page you need to have a row with a button that open the media gallery popup, where you can choose an image. In the ...
1
vote
1answer
2k views

How can I populate a select element with terms from a custom taxonomy and filter post results?

Alright, so first, I need you to check out this wire-frame so you can see what I'm trying to accomplish: What I've done so far is this: I created a custom post type for individual addresses. I ...
0
votes
1answer
38 views

Metabox multiple custom post select -> display selected items?

I'm building a theme that needs some cross-information(?) between custom post types. I have a metabox to select custom post types and display them inside the single page of another custom post type. ...
0
votes
1answer
13 views

how to SELECT meta values that are not null?

I have a rating system for our products but there is an issue: by the code, that will SELECT all comments in commentmeta table that have rating as meta_key. even those who do not have a rate (the ...
0
votes
1answer
494 views

Get value of selected option in select field in a Wordpress form

So I am trying to get which option is selected without submitting it to server side. I have 2 drop down fields, the first one is of last names and second one is of first names. Both are populated from ...
0
votes
0answers
24 views

Load respective custom field as input field when the select option is changed

I have 2 custom Posts Type Subject Clusters ( is a group of subjects) Subjects So when a new cluster is saved, it saves a group of subjects. Subjects (2nd custom post type) can be added via a ...
0
votes
1answer
89 views

Query a Custom Post Type using SELECT that has ACF fields to compare dates

So I have a CPT called ads that has ACF fields of ad_start_date and ad_end_date. I am trying to write a custom WP query using a SELECT statement instead of using WP_Query because I am return an ajax ...
0
votes
1answer
88 views

Reload page with a different shortcode when a user selects from a dropdown

I'm using WP Job Manager, and the page which lists all available jobs is delivered using a shortcode which can be customized. so [jobs per_page="10"] is outputed in the frontend as: <div class="...
0
votes
0answers
33 views

AJAX call recieving a 400 bad request when array lenght is to long

I have a select dropdown where users can choose multiple options that get's sent to a custom Rest-API endpoint and returns values based on their selection(s). The dropdown is dynamically populated ...
0
votes
0answers
198 views

Add select filter based on acf field to custom post type in dashboard

Good morning everyone; I am trying to add a select filter like this: Select filter based on taxonomy To do this, I am getting all field values like: Display all select field values I am able to ...
0
votes
1answer
396 views

choose selected for select option with condition [closed]

I have a select option like this <select name="select1"> <option value="value1">hots</option> <option value="value2">popular</...
0
votes
2answers
68 views

How to set different color in a select box due to selection with css

I have a select box with 2 options. In the selct area the options are green for 1 red for 2 I had been able to set green also as the color for the predefined option. Now I would like to change this ...
1
vote
0answers
40 views

How to output CMB2 select options from repeated groups select elements?

I've searched in previous posted questions but I can't find something similar (but if it's already posted, please let me know). I've got the following repeated group of fields, with a select in it: $...
1
vote
1answer
43 views

Creating select dropdown with parent-level custom post types

I'm trying to create a dropdown with an option for each top-level parent. I've gotten the query down because when I print the results, I see the posts I'm looking for. My code is also creating the ...
0
votes
1answer
164 views

Dropdown select filter and categories list

I have recently visited this website and came to know that it is running on wordpress. I have been looking for dropdown select filter (Banks Filter) and categories list as same as on that website. ...
2
votes
1answer
24 views

Export posts manually selected by end user (not logged in)

For an intranet project, I'd like to have not logged in users be able to manually check posts (with checkbox in front of post title on archive page) and be able to export some predefined data about ...
0
votes
1answer
78 views

Nested select statements not working

I have 2 tables I need to search. 1st table Name: Personnel Fields: id, lname, fname, department, extension 2nd table Name: department Fields: id, department The 2nd table has the full department ...
0
votes
1answer
48 views

Woocommerce add a text field if specific option is selected

I need to make active/visible a new filed before 'Add to cart' button, only if user select a specific option. The case is simple: I sell t-shirt with options: "Small", "Medium", "Large", "Size upon ...
0
votes
1answer
2k views

Sorting dynamic select/dropdown for Contact Form 7 of Modern Tribe Events posts

What I have is a dynamic dropdown/select box in Contact Form 7 I believe to be based on this: https://gist.github.com/morgyface/56474f0a37abb7d622880daf6eff6e40 It's been a while since I worked on ...
1
vote
1answer
730 views

Wordpress select field - show current value?

Function is generating select field, what can I do to set 'selected' currently saved value ... if possible? For example, previously I selected 36 and saved "update_option('_nos',$myvalue)" function ...
1
vote
0answers
11 views

Add select input with pre defined classes to insert image screen?

I'm looking for a way to add a select element (or some multiselect variant) with pre-defined classes to the image insertion screen in Wordpress. I've been looking around for some way to do this but ...
0
votes
2answers
4k views

add onchange to select in a wp form

I am using wp_dropdown_categories to create a dropdown in the frontend. It creates a nice dropdown select. Now I would like to add onchange="myFunc()" to the <select>. I need this to trigger ...
0
votes
1answer
657 views

Multiple selection for wordpress widget

I created my own category selection widget. So i used <select> but i want to use with multiple attribute. Here is my widget class. It works perfect without multiple attr. But i want to use it. ...
0
votes
1answer
1k views

Check if a value exists in database table

I have a custom self made registration form where a user needs to enter his address, I need to check if his address is already added in a custom table(which I have made manually with table prefix). I ...
0
votes
3answers
63 views

put a list of one post type in other post type to select from it and display selected item in second post type's single page

I have two post types in my website. one for courses and other for teachers. I want to put a selectable list of teachers post type in courses post type and then show it in course single page and link ...
0
votes
1answer
18 views

Menu selection for header

I have created multiple menus. What I wish to accomplish is give viewers the ability to select which menu they want to use for the header. Closest ive gotten to is the conditional menu plugin but that ...
0
votes
1answer
57 views

Wordpress admin area: select box with 12.000+ options

I have a custom post type that in admin area has a select custom meta box with 12.000+ options. So, in some cases, WordPress show an error message like memory exhausted. Which could be a good ...
1
vote
0answers
40 views

Get parent and children taxonomy in different dropbox

I would like some help, I have this situation Taxonomy = Location where Brasil = Parent - Acre = as first child -- Rio Branco = another child -- another city = another child -Santa Catarina = as ...
1
vote
0answers
14 views

Select Query demand excesive resources [closed]

Good Morning: I had detected that in a couple of times in the day I fond this query using a huge amount of resources in my wordpress server. The query start to make a copy to disk of almost all the ...
1
vote
2answers
1k views

Wordpress shortcode attributes for database SELECT?

I have created a small shortcode function with attributes to review if attributes are handled properly. That's the case and now I would like to use the attribute in a SELECT statement. But the ...
3
votes
1answer
4k views

Filtering custom posts with Ajax

I looked in other questions, searched on Google... And got nothing. I need to filter the posts from a custom post type based on the selected value. I have another part of the site where I use Ajax ...
0
votes
1answer
357 views

Echo Option Value Based On Wordpress User Role

If someone can figure this out, man you would make my week! Basically what I'm trying to do is echo a different value in a option based on a the users role on Wordpress. If user is administrator ...
1
vote
1answer
26 views

I have 2 post types i need to show the post type contents in 2 select boxes [closed]

I have 2 post types (Doctor specialization, Doctor Profiles).i need to show the post type contents in 2 select boxes.
0
votes
1answer
2k views

Changing select options based on previous select with PHP & AJAX

I looked at some answers here on SO and googled a bit... But couldn't make this work. I have 0 experience with Ajax and I'm new to PHP. What I need is to change the options of the other selects based ...
1
vote
0answers
213 views

Long running queries

I'm trying to build a PHP script that will pull the 10 most read posts (weekly) and will return me an XML file (so I can link it to Mailchimp). Im also using - Post Views Stats Wordpress plugin by ...
0
votes
1answer
628 views

Retrieve select tag custom values from array and display them in current page with wp_query?

I have a select tag (in filter.php) with different training prices ($80, $120, $500, etc). The values are stored in the array $options (thanks to Tom) : I'd like to display, when visitor clicks in $...
0
votes
1answer
167 views

Create multidimensional array of taxonomies

Create multidimensional array of taxonomies Hello all, I need to create a multidimensional array to populate my select via javascript. At the beginning are two selects of taxonomies, 'store' and '...
0
votes
1answer
1k 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
1answer
10k views

Custom contact form 7 select with custom values [closed]

I have been searching for a way to add a select field to the Contact form with custom data. The goal is to have a form where someone can ask for information on an article by selecting the article ...
0
votes
0answers
1k views

add image in dropdown select

if (!function_exists('dropdown_categories')) : function dropdown_categories($show_option_none, $name, $selected = '') { if (of_get_option('blog_cat_id')) { return apply_filters('...