Questions tagged [select]

The tag has no usage guidance.

51 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
60 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>&...
2
votes
1answer
25 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 ...
1
vote
0answers
87 views

Gutenberg get core data - search

I am trying to query data in gutenberg like search in REST API. Following this documentation: https://developer.wordpress.org/block-editor/data/data-core/ I came up with this select: wp.data.select(...
1
vote
0answers
118 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
698 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 ...
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 ...
1
vote
0answers
47 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
267 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 ...
1
vote
0answers
475 views

Woocommerce Product Custom Select List (not variation)

I'm not asking anyone for a whole solution (although I'd gladly accept), but rather for someone to point me in the right direction as to how to accomplish this. I am a web designer with intermediate ...
1
vote
0answers
1k views

How to add select list to meta box field?

I have created custom meta box field product_statuss to my CPT product. I want to predefine four possible statuses and display them as dropdown list but have spent 4+ hour running the same error. Here ...
1
vote
0answers
41 views

wp_Qwery works to slow

I have 266 806 rows in wp_posts, and when I'm trying to get post this help of WP_Query or DB SELECT which sort parameters it's gets results more when 0.3ms Exemple of SELECT: SELECT ...
1
vote
0answers
11 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
vote
0answers
469 views

Front-End Custom Taxonomy Tag Select

The theme I am currently using features a front-end dashboard with posting and post editing, but the pre-existing submission form currently lacks a field to select one or more custom taxonomy tags (...
1
vote
0answers
437 views

Multi-select field for Taxonomy can't save the value

I'm trying to create a multi select field for Taxonomy pages, and the problem is in saving all the selected values, for example if I choose couple of elements in the select field and save it, it will ...
0
votes
0answers
15 views

set focus on component

How to set a focus on component (select component) inside block, when building custom block? I tried React-way using useEffect and useRef, but it seems that component misses focus method. This is my ...
0
votes
0answers
13 views

WordPress Gutenberg Signal on Block Alignment Change

Is there any selector I can use to subscribe to an block alignment change? I am writng a custom block that needs to do some actions when the user changes the block alignment to 'wide' or 'full'. I ...
0
votes
0answers
101 views

How to make a pagination with dropdown selection?

This is the code for the dropdown pagination. It uses a js controller too, but it works fine, so, I’m not adding it. $total = $wp_query->max_num_pages; // only bother with the rest if we have more ...
0
votes
0answers
9 views

How we show dropdown pages values in admin sites When we Click on save button?

add_settings_field ( 'WhattsApp_Advance_Pages_fld', // ID used to identify the field throughout the theme esc_html__('Where you Want To display?', 'Woo-WhattsApp'), /...
0
votes
1answer
36 views

CF7 select value get to function and reciept value from function

Si I try to asking different How I can get the value from following field: <label> Geburtsjahr/ année de naissance (Pflichtfeld) [select* annee include_blank "1940" "1941" &...
0
votes
0answers
16 views

Dynamic Select Field fil up with 2 others Select Fields

Hello Wordpress Community I'm really a beginner and need helps, is someone willing to give me a hint or help me. I watch a lot youtube videos I tried to create my own Form. But now I need help. Here's ...
0
votes
1answer
17 views

How to search usermeta table

What is the best way to search usermeta to find a user_id based on a meta_value? For example in usermeta table there is a row with user_id = 123 , meta_key = deviceid and meta_value = 45545. I know ...
0
votes
0answers
7 views

Category list popup

I have my products categorized by the name of the cities. I want to show a popup to select the city i.e category when someone visits my shop page. Kindly Help
0
votes
0answers
20 views

Load google font script based on optgroup label selected

Ive searched and can't find an answer. I have two groups of fonts - one regular fonts and one google fonts. Im using a select dropdown list with two optgroups, one for each group of fonts. What Im ...
0
votes
0answers
106 views

ACF Dynamic select values not showing data

This question makes me crazy for almost 2 weeks. I know I am not expert in Wordpress, so I am seeking for help here. I have create a href that when user click it will go to new page. <a href="./...
0
votes
1answer
274 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 ...
0
votes
1answer
258 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
2answers
2k 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 ...
0
votes
1answer
588 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. ...
0
votes
1answer
118 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
110 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
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
63 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 ...
0
votes
1answer
441 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 ...
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('...
0
votes
1answer
24 views

database select issue

I am writting plugin where i have custom table. I am trying to access one random row from last 5 rows from this custom table. "SELECT * FROM $table_name WHERE id > MAX(id)-5 AND id < MAX(id)+1 ...
0
votes
0answers
667 views

Implementing Select2 plugin into Wordpress

I am currently trying to implement the Select2 plugin in my Wordpress site to get the beautiful dropdown select boxes that allow users to select multiple items. I have pasted the following code ...
0
votes
1answer
1k 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 ...
0
votes
1answer
524 views

WordPress Multiple Taxonomy Query

I've a simple form made up of two multiple selects which (as if by magic) filters my posts archive with URL parameters: <form class="filters"> <select name="country" multiple> ...
0
votes
1answer
488 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
676 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
273 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
1k 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
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
255 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
1k 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
0answers
1k views

Auto Select Child categories on Multiple Dropdown - Jquery

I am using the wp_dropdown_categories to generate the form and select option, with multiple select jquery plugin. What I want is that, when the user selects the Parent category or (level-1) then the ...
0
votes
0answers
155 views

Combine Query and Select Database to create directory loop

I have a query loop on my page that I am using which displays all users on the page with certain custom fields filled out. It's working fine however, I need to also query these users for their level ...
0
votes
1answer
128 views

Sanitizing a custom query's clauses

I'm trying to build a custom query much like the one found in WordPress' native get_posts() inside wp-includes/query.php, meaning something along these lines: global $wpdb SELECT * FROM $wpdb->...
0
votes
1answer
179 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 ...
-1
votes
1answer
1k views

Open WordPress Page from selected option dropdown

Code/process to get option dropdown menu selection to open page in WordPress with php? Tried all kinds of plug-ins, widgets, but none will make menu that fits requirements of project so far. ...