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
- 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 get only one category of custom post type?
- Get all taxonomies for all post types
- Append taxonomy terms as class names in markup?
- 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
- CPT Search Form with Taxonomy filter & Or
- Keyword search limited to specific post type filtered by multiple custom taxonomies?
- How to output wordpress custom tags separated by comma?
- Weird problem happening with custom taxonmy when creating/updating posts
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- get_posts of Custom Post Type AND Custom Taxonomy
- Received nothing after executing AJAX post function
- Search Custom Post Type & Taxonomies
- Tax query not producing any results
- WordPress sort search results by custom order
- How to Filter custom post type by taxonomy?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Categorize custom post type
- Pretty URL for custom search for custom post type
- How do I display the grand child items of a taxonomy term?
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- Auto Complete Search
- search suggest – filter post type
- Search by tag name and category
- Advanced search form with filters for custom taxonomies
- Include custom taxonomy term in search
- How to display Related Posts based on number of taxonomy terms matched
- tax_query not working in template
- Get term name without a foreach loop
- Trying to get custom post of a custom taxonomy
- WP_query – Filter by tax_query and meta_query using multiple select
- Get custom post type categories to show up in menus
- WP_Query parameter conflict
- Show current custom taxonomy
- Custom Taxonomy Search result page
- Custom Search | check multiple meta_value for search value
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- Hide custom post type from search based on custom taxonomy
- tax_query (if the terms are empty)
- Multi Parameter search with custom post type category and tag
- Foreach loop returning more than one item when querying taxonomy
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- Custom post type page with parameter
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- How to Implement Search Functionality?
- How to have multiple search result pages in wordpress with taxonomy terms listed
- 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
- 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
- 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
- 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?
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Extensive search filtering and results->PDF in the front-end
- Values inside a custom field to determine which category posts to display
- Custom Search not working
- Show Custom Post Type taxonomy term that matches custom field
- Order by custom field attribute
- 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
- Archive custom template from search
- Inserting two categories
- How do loop categories post from according in WordPress? is it impossible to solve this problem?