I think you can do it in two following steps:
-
In HTML code just add a dropdown with the values you need.
<select name="yourselect"><option value="1">Value 1</option> ... </select>
-
In your
pre_get_posts
filter addtax_query
parameter like thisif( !empty( $_GET['yourselect'] ) ) { $query->set('tax_query', array( array( 'taxonomy' => 'YOUR_TAXONOMY_NAME', 'field' => 'id', // or slug if you want 'terms' => $_POST['yourselect'] ) ); }
I’m not sure if it is a good idea to configure this way the default WordPress search. A couple months ago I already implemented similar functionality using AJAX filters. Example is here, hope it helps https://rudrastyh.com/wordpress/ajax-post-filters.html
Related Posts:
- Include custom taxonomy term in search
- Advanced search form with filters for custom taxonomies and custom fields
- How to replicate some of Drupal Views functionality in WordPress?
- Exclude from search all custom posts which are NOT in a taxonomy term
- Exclude a term of a taxonomy with a custom post type in a search
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Custom search for custom post type, custom meta and search fields
- Is there An Input Checkbox Option That Works like `wp_dropdown_categories()` To Use In A WP Search Form?
- How to search from specific post type with tags?
- Include different loop templates in search query
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- Keyword search limited to specific post type filtered by multiple custom taxonomies?
- How to create an advanced filter search?
- Search Custom Post Type & Taxonomies
- search also in taxonomy, tags and custom fields
- WordPress sort search results by custom order
- Pretty URL for custom search for custom post type
- Auto Complete Search
- Search by tag name and category
- Advanced search form with filters for custom taxonomies
- dropdowboxes with pre-selected custom fields optios that filters the results according seach needs
- Include custom taxonomy term in search
- how to get this tax_query working?
- Custom Taxonomy Search result page
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Custom Search | check multiple meta_value for search value
- Hide custom post type from search based on custom taxonomy
- Ideas on how to organize a project [closed]
- Multi Parameter search with custom post type category and tag
- How to Implement Search Functionality?
- How to have multiple search result pages in wordpress with taxonomy terms listed
- WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
- Live search by custom tag
- Custom search for a custom post type in WordPress
- Extensive search filtering and results->PDF in the front-end
- Advanced search form with filters for custom taxonomies and custom fields
- Archive custom template from search
- Custom Field Search
- Create a shortcode to display custom post types with a specific taxonomy
- List the categories under custom taxonomy
- Custom Post Type and Taxonomy URL rewrite
- Returning search results by relevance, including Custom Post Types
- Archive page with multiple taxonomies rewrite
- Sorting for each custom taxonomy
- How to get_queried_object on multiple objects?
- Dynamic variable for custom taxonomy in loop?
- custom taxonomy – Template not working
- Count number of posts which exist in 2 taxonomies?
- Want to turn WordPress into a paid subscription directory
- Removing Duplicate Custom Taxonomy Terms from within a Dropdown Select?
- I did group my search results by post type, but how can i give each of them its own order?
- Custom Taxonomy Navigation, with current menu items for children?
- A question on creating filters for custom posts using taxonomy
- How can I made custom taxonomies relationship?
- How to start a new post with custom Taxonomies already set?
- Custom Post Type by Taxonomy
- Losing Nav Active State in Menu
- Different rewrite rules for taxonomies and cp in multisite?
- count results in search page based on custom category
- Assign Custom post to Custom Taxonomy
- Trick to get custom post types to show up on a custom taxonomy page?
- How to add custom taxonomy in custom post type permalink?
- Custom select query for taxonomies that have posts categorized in another taxonomy
- Create an archive page for custom post type with custom taxonomy
- Custom Post Types Archives and Single Pages not showing custom taxonomy data
- How to setup a single post page for my custom post type?
- Dynamically insert code to custom post type loop
- Link From Single Post To Taxonomy Term Archive Page
- Pull in taxonomy field of custom post type in new query
- Use the custom post type archive for taxonomies?
- Taxonomy template page not working
- Issue with Custom Post Types and Single
- How to count other posts not having specific taxonomy terms?
- Looping through custom taxonomy and display custom post types (Custom Post Type UI)
- How to create subdomain for custom post type and associated custom taxonomies
- set post_type based on custom taxonomy permalink
- How can I tell if I’m on a custom post type archive page?
- Can’t Get Parent and Child Categories of Custom Taxonomy to Display
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Should I use a custom taxonomy or custom post type for grouping a list of panels associated with a group of tests?
- Why are custom taxonomies only appearing on the edit page of one of these types, but not the other?
- Search CPT by tag ids
- Custom post type 404 category page
- How to associate custom taxonomy terms with custom post type?
- WP_Query not using custom taxonomy categories on custom post type
- Taxonomies are not showing in the category dropdown
- get_the_terms child terms for current post/custom post only
- Custom taxonomy- only output relevant terms
- Post types showing tables…Can I do that?
- Post Custom & Taxonomy 404 error
- Dropdown switching subcategories portfolio
- Is it possible to add and display custom post types to an array?
- Custom post type and custom taxonomies display
- Displaying posts exclusively in their category (not parent)
- Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy
- Adding rewrite rules to Custom Post-type mixed with Taxonomy
- Inserting two categories
- How to manage a bookstore
- Permalinks for Custom Post Types and Taxonomies
- Group search results by post type, but having a unique heading for each section?