I believe changing your operator to ‘AND’ like below will work:
$selectedOptions = array('test-attribute', 'test3');
$args=array(
'post_type' => 'product',
'post_status' => 'publish',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'pa_filterable-attribute',
'terms' => $selectedOptions,
'field' => 'slug',
'operator' => 'AND'
)
)
);
Related Posts:
- WordPress tax query use operator LIKE
- tax_query will produce nothing
- Multiple, nested tax_query relation
- Can’t make a tax_query across different post types
- using multiple terms in tax_query
- in_category() and tax_query with custom post type
- OR for a single taxonomy in a tax_query
- simple tax_query intersection
- How to set `tax_query` with `query->set()`
- tax_query will produce nothing
- Escaping WP_Query tax_query when term has special character(s)
- Tax_query terms ID’s using variable
- The Operator “NOT IN” Does Not Work In tax_query
- Order posts by (hierarchical custom) taxonomy terms and term children
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- How to combine tax_query and date_query in WordPress
- Specify number of posts in my ‘tax_query’
- Problem with get_posts, tax_query and counting the number of posts
- Count number of posts which exist in 2 taxonomies?
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- How to extend tag and category “Related Posts” query to custom post_type if the first 2 terms have no posts
- Using tax_query reverses my post_type argument in a custom WP_Query
- List taxonomy / category count showing list published posts only
- tax_query shows no results if nothing is selected
- get complex results set according to category structure
- WP_Query tax_query on ACF post_object
- WP_Query tax_query problem
- How to output content based on same custom taxonomy?
- How do I sort posts by custom taxonomy?
- WP_Query, tax_query and term_meta: How to?
- Empty tax_query array returns an empty array
- How can i simulate “taxonomy__in” in query?
- Meta Query relation “AND” not working
- Nested tax_query that allows specified categories OR tags, but NOT other categories
- Populate tax_query terms parameter with post term
- Tax query not producing any results
- Fastest way of counting posts of a custom post type in a specific taxonomy term?
- Is it a good idea to improve meta query performance by adding tax query?
- WP_Query | Tax_Query Relation | Unable to use ‘OR’ as it then allows all products, help me finish my query?
- Why is this query not working? (Standard posts + custom post type)
- Using meta_query and tax_query at the same time
- Retrieve Custom Taxonomies according to posts selected
- Tax query AND/OR meta query [duplicate]
- Custom Taxonomy Not Working When added to WordPress Search
- Hiding taxonomies with no children WP_Query & tax_query
- Exclude posts which have any term in a certain taxonomy from the query
- How to display Related Posts based on number of taxonomy terms matched
- tax_query not working in template
- Finding WordPress Posts assigned to multiple categories
- WP_query – Filter by tax_query and meta_query using multiple select
- WP_Query parameter conflict
- How to do a particular wp_query taxonomy search
- Is it possible to query posts with tax queries after multisite switch_to_blog() function?
- Set both meta_query and tax_query using wp_query->set
- $query->is_main_query() is causing query’s tax_query to be ignored
- How to print term name inside wp post loop
- Get posts in taxonomy randomly
- Loop posts based on permalink term
- tax_query (if the terms are empty)
- tax query shortcode
- Function using get_posts() with tax_query not working when called from functions.php
- Running a custom query inside another cpt single and trying to grab a variable
- how to access the $query variable inside taxonomy-xxx.php template file?
- how to use tax_query to apply both terms or one if one is empty
- Show multiple tax_query from 2 or more post_type in a single code
- Query all posts under one taxonomy? Why is my code not working?
- Any quicker alternative for WP_Query “NOT IN”
- Tax Query on product_cat using NOT IN as operator does not exclude that category
- Get Posts Related to Category By category id or slug
- problem with setting tax_query in pre_get_posts
- AJAX not working when clicking load more button, when two terms are present in tax_query
- Show posts from two specific category in WP_Query
- I’m having trouble with Related Product “tax_query” ‘terms’ value
- Multiple dynamic Tax Query – pass taxonomy argument from array
- custom post type and a “sticky” position taxonomy
- WP_Query for a taxonomy value OR a custom post type meta field
- wp_query with meta_query and tax_query
- Select multiple categories with is_tax
- list all post who have mutual taxonomy as current taxonomy!
- Cannot get to work tax_query array for terms
- Why pagination is not working with tax_query param?
- Query child posts with tax query on parents
- How can I get the last 5 element of this tax query?
- WP Query tax_query not returning posts
- Parse error: syntax error, unexpected ”tax_query” in wordpress
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- WordPress Multiple Taxonomy Query
- Using get_posts, I need to use a combination of OR & AND relations
- Query breaking with ‘posts_per_page’ => -1
- Custom query for tag and custom tag from 2 post type
- Multiple terms not working on taxonomy
- List posts of terms but exclude one term
- Display related posts with same category or same tag return blank
- WordPress hiding posts without content on custom taxonomy query. How to solve?
- Woocommerce – Shipping tax class based on cart items not using the highest tax available
- How to pass >= condition filter to my year custom tax_query
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Custom query for certain post type OR another post type with a certain category
- WP Query Conditionally query meta and taxonomy
- Complex Taxonomy scheme