Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The tag has no usage guidance.

0
votes
1answer
11 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
0answers
8 views

sql query for selecting btween two amounts

I am trying to achieve result by selecting dropdown between two amount range. echo '<option value="browse-events?city='.$browse_city.'&type='.$browse_type.'&price=Free">Free</option&...
0
votes
1answer
23 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
0answers
116 views

Retrieve data from MySQL into dropdown using AJAX

I'm trying to retrieve data from MySQL into dropdown using AJAX, but the results of the dropdown are not displayed. Here's the snippet: Form: <?php global $wpdb; $aName = $wpdb->get_results("...
0
votes
1answer
50 views

ACF: Filter Conditional Logic Sub Fields Based on Parent

I am trying to create a search that filters posts by country and state/region/province. I have created some conditional logic sub fields based on country and now I am trying to figure out how to ...
0
votes
1answer
73 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
27 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
8 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
39 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
75 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
58 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
17 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
24 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
26 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
12 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 ...
0
votes
2answers
144 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
198 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
545 views

Selected option in dropdown not showing

hope you can help me. If has created a custom meta box for pages. In this box I have a select dropdown with three options. On save it saves the right selected option. But after save the selected ...
3
votes
1answer
1k 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
24 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
815 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
73 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
323 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
62 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
4k 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
596 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
73 views

Get Link of Page Selected through a Select Field in Custom Admin Page

I've created a list of pages in the backend of a Wordpress site using wp_dropdown_pages();, which of course shows a dropdown of existing pages. What I'd like to achieve is retrieving not the name but ...
0
votes
1answer
444 views

Default URL for category dropdown select option

I have a dropdown menu for my categories: <form action="<?php bloginfo('url'); ?>" method="get" id="catform"> <?php $parent = get_cat_ID("Pictures"); $select = ...
0
votes
0answers
230 views

parent and child select box for taxonomy

hi i have submit form for adding post to my site my problem is with taxonomies i have three select box for parent , child and grandchild of my taxonomy my problem is that i cant figure out how to load ...
0
votes
3answers
69 views

ACF Pro select field problem [closed]

I am trying to use ACF Pro Select field to display a specify social media icons. So I have this code in my theme: <?php if( get_field('social_medias', 'option') == 'facebook' ): ?> &...
0
votes
3answers
90 views

How to convert select to HTML with PHP tags inside of it [closed]

I apologize for asking such a simple question, but I am having a world of struggle in trying to convert the following echo statement to HTML with php tags inside of it. I am trying to get my custom ...
0
votes
0answers
33 views

Mark an option as selected - categories dropdown

I'm making a theme settings panel for a wordpress theme that have an option to chose a categorie to show in the index. Everything is working well, except the "selected" thing. Can anyone help me? &...
1
vote
0answers
369 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 ...
0
votes
1answer
22 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 ...
1
vote
1answer
296 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
34 views

Select field value not returned after saving changes

I've been searching around for an answer to this one but have had no luck thus far… forgive me if it has been answered somewhere before! I'm currently writing a plugin and I'm using the WordPress ...
0
votes
1answer
412 views

How to call custom jQuery plugins into the customizer controls

I never tried to use the theme customizer, somehow I don't find that thing good. But recently I tried it, and stuck into this matter. I extended the Class WP_Customize_Control to made my own <...
1
vote
1answer
34 views

Need a help on sanitization

I have a theme on review, and I do add section 'type'=> 'select' on few occasions like this. $wp_customize->add_setting( 'personal_lite_post_link', array( 'default' => 'enable', ...
2
votes
3answers
6k views

Select dropdown not showing selected value php

I'm using Wordpress Settings API. Everything works as it should except this select dropdown. When I select an option, the value echoed is correct but in the dropdown it displays the default first ...
0
votes
0answers
434 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
41 views

SELECT statement wrong?

This code works correctly down to the eighth line from the bottom. The SELECT statement there does not find the one record that was just inserted. It is the only record in the table at this point. ...
2
votes
2answers
11k views

Style the last element having a specific class [closed]

I have a code like this. <div class="slick"></div> <div class="slick active"></div> <div class="slick active"></div> <div class="slick active"></div> &...
0
votes
1answer
479 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
2answers
2k 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 ...
7
votes
2answers
5k views

How to correctly submit a search form and display the result in an independent page

I have part search function in my WordPress website which uses dynamic dependent select box. However, now I have the following problem: If only select the first one box, or select the first two ...
5
votes
1answer
79 views

Wordpress parent select need to be removed

Hi i have a Wordpress installation with over 35000 pages which are sorted into trees like so ... There is an ongoing issue with page edit loading very slowly or failing to load at all. Through long ...
0
votes
1answer
107 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
35 views

Get 3 row ID's via ARRAY_A

Below query works fine. But how can I select the 3 results separately with the array_number? I need to separate the 3 results correct with help from the array_number. But do not know how. $records = ...
2
votes
2answers
1k views

Triple meta_key on custom SELECT query

I'm using a weird SELECT query to calculate the average of all the post ratings (stored in wp_postmeta) for a certain user. My query basically uses the following arguments: post_author = 1 AND ...
1
vote
0answers
853 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 ...