Change operator
to IN
:
array(
'taxonomy' => 'features',
'terms' => $feature_slugs,
'field' => 'slug',
'operator' => 'IN',
),
That will query posts that have any of the terms in $feature_slugs
, rather than all of the terms, which is what AND
does.
Also, I can see you’re using the POST
method for this search. That type of request is inappropriate here. When you are requesting data you should be using a GET
request and accessing the data with $_GET[]
.
POST
should only be used when sending data to the server to be processed, usually when it will create or update a resource.
Related Posts:
- tax_query not working?
- Include custom taxonomy term in search
- Advanced search form with filters for custom taxonomies and custom fields
- Get Custom Taxonomy ID within loop
- Search that will look in custom field, post title and post content
- The Operator “NOT IN” Does Not Work In tax_query
- Get custom post type by category in a page template
- 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?
- Categories under custom post types doesn’t show properly
- Order posts by (hierarchical custom) taxonomy terms and term children
- Custom search for custom post type, custom meta and search fields
- Include images from pages in wp search.php results in default wp search
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- Ajax filter with custom taxonomies
- Filter posts with ajax form and checkboxes
- Is there An Input Checkbox Option That Works like `wp_dropdown_categories()` To Use In A WP Search Form?
- Count number of posts which exist in 2 taxonomies?
- How to search from specific post type with tags?
- Include different loop templates in search query
- How to get only one category of custom post type?
- Get all taxonomies for all post types
- Append taxonomy terms as class names in markup?
- Show ACF field from custom taxonomy and display on the single template
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- List terms from Custom Taxonomy
- Query for custom post type objects in a taxonomy and with a meta value
- WP_Query search posts by custom post type and custom taxonomy
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Trying to get custom post of a custom taxonomy
- WP_query – Filter by tax_query and meta_query using multiple select
- Control content before and after custom post type loop
- Get custom post type categories to show up in menus
- WP_Query parameter conflict
- Show current custom taxonomy
- how to get this tax_query working?
- Custom Taxonomy Search result page
- Different options per post type in WP_Query
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- Creating a non-hierarchical Taxonomy that behaves like categories
- Custom Search | check multiple meta_value for search value
- When I choose category from dropdown then everything working fine.But in backend it checked only child not parent [closed]
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- Hide custom post type from search based on custom taxonomy
- Query custom post types & Taxonomies and list them in a table on a page
- update custom taxonomy custom fields
- Filter taxonomy by CPT
- Get all post under custom post type grouped by custom filed value in custom taxonomy
- Check that a slug is present in the get_terms request
- I’m having trouble with Related Product “tax_query” ‘terms’ value
- custom post type and a “sticky” position taxonomy
- Assigning categories to custom post types via a front-end form; only works for native post type
- How to search through all child taxonomies using WP_Query?
- pagination problem listing custom post types of taxonomy in wordpress
- In the php, how can I have a category of a custom post type display?
- Taxonomies are not showing in the category dropdown
- Combine multiple separate lists into one
- Live search by custom tag
- Filter Custom Post Type Posts by Taxonomy
- Change Search display for Custom Post Type
- Show parent category and subcategory once in while loop
- Custom Taxonomy – fields
- How can I get the last 5 element of this tax query?
- Getting Custom Posts with Custom Taxonomy
- Add active class to foundation 6 tabs while looping categories
- WP Query tax_query not returning posts
- Include images from pages in wp search.php results in default wp search
- The most recent post of custom taxonomy
- Error get_posts with Custom Taxonomy and OR relation
- Show tags of custom post types in WordPress
- How to show post which has the specific taxonomy terms?
- WordPress query posts by custom post type not workng
- Show custom taxonomy not in submenu
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Pods pagination erases my sub menu
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- How to Fix WordPress 500 Internal server error due to custom post type
- Extensive search filtering and results->PDF in the front-end
- tax_query showing no results
- Values inside a custom field to determine which category posts to display
- Custom Search not working
- Exclude Custom Post Type from shared Custom Taxonomy
- Show Custom Post Type taxonomy term that matches custom field
- WordPress Custom Post Type and sort by Tags
- Order by custom field attribute
- Looping taxonomy in taxonomy?
- Advanced search form with filters for custom taxonomies and custom fields
- Building a List of Posts grouped by custom taxonomy as the section header only to be displayed if at least one post is in that tax
- posting twice from an array?
- Custom Loop for custom post type. Compare by meta_value?
- Archive custom template from search
- Inserting two categories
- Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT
- Custom Field Search
- How do loop categories post from according in WordPress? is it impossible to solve this problem?
- WP Query Conditionally query meta and taxonomy
- Search for portfolio tags & mixing portfoliotags and post tags