Per the Codex:
relation (string) – The logical relationship between each inner
taxonomy array when there is more than one. Possible values are ‘AND’,
‘OR’. Do not use with a single inner taxonomy array.
So you are on the right track, but your tax_query
is wrong. relation
is part of the outer tax_query
array and not part of the top level query arguments.
$query_args['tax_query'] = array(
'relation' => 'OR',
array(
'taxonomy' => $post_type . '_filters',
'terms' => $terms,
'field' => 'id',
)
);
Related Posts:
- How to list some posts first in the loop based on post id
- ajax category filter
- Display posts the match taxonomy term linked from wp_list_categoies?
- How to order posts tag by tag?
- Move posts to top of WP_Query if in certain Taxonomy?
- How to get any tag ID
- Multiple Loops Inside a Function
- How do I run through a WordPress loop called from a filter function?
- How to filter, restrict and return posts based on custom user meta information
- Post loop for all taxonomy terms
- Redirect to another page using contact form 7? [closed]
- how to access query string in wordpress?
- Custom taxonomy.php not working
- how to use pre_gets_posts to exclude one queried ID from homepage loop
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Loop posts based on permalink term
- Filtering by multiple conditions in the loop
- Why does apply_filters behave different inside and outside a loop?
- WordPress – Form does not filter the results of taxonomies
- Custom query for custom post type not getting correct post ID
- Custom category page with taxonomy filters
- pages shortcode filtering by category
- Get post Number with local loop and template
- WP_Query doesn’t works inside loop
- Only seems to be displaying one child when there are supposed to be multiple
- Problem with custom WP_Query and underlying pagination/posts_per_page
- Calling a function with WP_Query only ever brings the first result
- How to write a query-function as a query-shortcode?
- tax_query not working properly with get_posts
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- Custom query for certain post type OR another post type with a certain category
- Loop a Single Taxonomy and Output all Posts Associated (but also show a message for empty ones)
- Need help with Query Loop. Need to get current taxonomy term and its posts and group them by a different selected taxonomy term
- How to Filter Posts by Custom Fields?
- Display posts from only one post form in custom query and exclude in main query
- Multiple loops without repeating content
- Show Sticky Post at the top but do not show again in the loop?
- Any number in meta key (wp query)
- Loop returning only 1 result
- WP_Query condition affects posts_per_page count
- How to return only one instance of each, from the entire loop
- Where is the WP_Query instance instantiated (when working with themes)?
- How to get all unique categories for posts in loop?
- Can I set my WP_Query to be a Main Query?
- Custom Search Not Consistent with Results
- Remove category from query (show all posts in archive.php) pre_get_posts()
- is_tax() function not working as expected
- Advanced Taxonomy Queries WordPress
- Having a Function Inside of the Loop
- Order by title without taking into account ‘the’
- Display both standard posts in a specific category along with a custom post type in a single loop?
- How can I filter by slug depending on language selection
- How do I get the title of a category in a custom loop?
- WordPress Loop and $post
- Group and list posts by custom taxonomy
- Show scheduled posts in main loop but not in WP_Query?
- wp_query ‘s’, search filter with pagination is not working
- Display Featured Post by Categories and Avoid duplicated posts
- Change query based on post type while staying in loop
- Using the_post_thumbnail resets current loop item ID
- Filtering posts from different categories into different section by doing WP_Query only once
- Category applied to pages, creates multiple breadcrumb entries after a search query (On the translated site)
- Get authors by term id or slug
- Change post order random through out the entire WordPress
- Orderby is working with one query but not with other
- Bypass “supress_filters” in WP Query
- WP_Query tax query part of slug
- How to use the query hook/filter?
- WP Query using tax_query & meta_query
- Get a list of posts with associated meta_value
- Taxonomy Query Relation field not behaving correctly?
- Filter posts in category archive page by year using a dropdown
- Show post number in widget loop
- WP Query Args – Title or Taxonomy Value
- How to Union two different conditions in one WP_Query
- Display filtered results into custom page
- Order by empty custom field
- posts_per_page not working for first page of pagination
- Slow queries on a huge database
- 1/3 of posts different class
- wordpress search word, “hello world” ===> ‘hello+world’ ===> ‘hello’, ‘world’
- How do I exclude the lowest level terms in a taxonomy?
- Search Query for multiple categories using ‘OR’ but having certain categories be ‘AND’
- Out Of memory issue on post per page parameter
- $WP_Query: How to display excerpt on first post only
- Loop Performance > JSON files vs. WP_Query vs. REST API
- Two loops on archive page
- Loop Split two Columns
- How to order posts by title after they have already been sorted by category
- Excluding pages in WP_query using ACF
- reset to main loop doesnt work
- Applying posts_clauses filter to specific queries only
- Check if loop has any categories?
- Add class to first post in custom loop using post_class filter
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Display most popular in the past two days
- Some doubts about how the main query and the custom query works in this custom theme?
- WP_Query with different postmeta filter for each categories
- Search form not working with custom query?
- meta_query not working as expected