Questions tagged [select]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
19 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
1answer
20 views

show label text of select option rather than its value in cmb2

I am trying to display the label text of my CMB2 select not the value on the frontend. Currently my select field displays a list of a specific custom post type called fleet. When I add $gas = ...
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
34 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
15 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
32 views

Filter multiple dynamic dropdown lists within one form using the Smart Grid-layout extension for Contact Form 7

I recently found solution for populating dropdown list with terms relative to the post. Everything works but I need to use this code on multiple dropdown lists within one form. My code looks something ...
0
votes
1answer
16 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
6 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
1answer
14 views

Fill custom select field with pages/post titles

I'm just getting into the world of SAGE development and at the same time, I'm using the Advanced Custom Fields plugin. Let's say, that we have created two custom post types (Professors, Lessons). ...
1
vote
0answers
54 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(...
0
votes
0answers
18 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 ...
1
vote
1answer
114 views

Populate dropdown from database

I am creating a custom plugin for our martial arts school and have come up against a problem that is doing my head in. No doubt I am missing something obvious but have never really dealt with ...
0
votes
1answer
160 views

ACF Dynamic select not showing data

I have a question. I have 2 types of custom field group: Group A and Group B. All I am using ACF. In Group A, I have field name course_trainer. This field type is a User type and can have multiple ...
0
votes
0answers
69 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
134 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
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
0answers
23 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
1answer
150 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
25 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 ...
0
votes
1answer
73 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
83 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
36 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
699 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
1answer
190 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
161 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
1answer
657 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
692 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
95 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
636 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
1answer
58 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
372 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
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 ...
0
votes
1answer
109 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
74 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
3k 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
1k 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
1answer
1k 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
3k 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
69 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
60 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
46 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
2k 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 ...
0
votes
1answer
414 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 ...
4
votes
1answer
5k 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 ...
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
3k 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
249 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 ...