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
- Some doubts about how the main query and the custom query works in this custom theme?
- Using a custom WP_Query with get_template_part loop
- WordPress 4.9.5 PHP intermittent warning trim() expects parameter 1 to be string, array given
- Merging a complex query with post_rewind and splitting posts into two columns
- Pagination Not working on Home Page with 2 Query
- meta_query not working properly
- Exclude post on loop by multiple meta key value
- Sort by meta key on archive page
- Query sticky posts with thumbnails
- Show all parents and children in custom post type in right order
- Why is this coming back as null? Thats wrong. There is one post
- Ignore post by meta value in the main query
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- What’s the point of the query_vars filter?
- How to retrieve current page WP_Query arguments?
- Order taxonomy terms in alphabetical order
- How do I search inside specific taxonomies in WordPress
- How to limit WP_Query to one result on the loop?
- Random loop with code to prevent duplicate output returns no output at all from time to time
- How to use offset in WP_Query
- How to use filter hook “the_posts” with a function that refers to $this?
- Multiple loops without repeating content
- How can I filter by slug depending on language selection
- Filtering posts from different categories into different section by doing WP_Query only once
- WP Query Args – Title or Taxonomy Value
- Slow queries on a huge database
- wordpress search word, “hello world” ===> ‘hello+world’ ===> ‘hello’, ‘world’
- WP_Query with different postmeta filter for each categories
- Slow WP_Query with ‘OR’ on meta_query
- Automatically Query Parent Taxonomy
- different for loop if screen resolution < 1000px
- Transient api Caches confused
- WP_Query for a taxonomy with different taxonomy types
- sort and display posts by custom field (wp-query and the loop))
- How to load a script code only in posts?
- inserting content of 1 Post to in another with a template hierarchy
- Pagination for custom loop on custom page template is not displaying anything
- How to access $wp_query object from array of posts given by get_posts?
- Display all attached image of every post of custom post type and link to original post
- I am officially missing something about transient posts
- How do I get the content of a custom instance of WP_Query?
- Only show tag with the same id as the post
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- How to use the Term Object from a custom select field in a query
- How to check if logged in user have pending custom post?
- Show a message if there are no active posts in category
- WordPress Ajax filter: Create two loops for different output styles?
- Problem with my loops
- How to upload 3 attachments to current post?
- display the children of the post using the current page as the main parent
- Display 3 levels of categories on page
- Paging works correctly on local version, but not live?
- Custom post type loop error: Trying to get property of non-object
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Display three sequential posts on each page load, without repeating previous
- How to make a wordpress loop file that displays posts based on certain conditions
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- Issue in If else condition [closed]
- Pagination not working with WP_QUERY
- How do I display posts with specific value in a custom field into my loop?
- Order by multiple meta keys on wordpress
- wp_query pagination links producing 404
- Display First posts without the default featured image
- Way of getting queried loop before the query with a filter hook?
- Pagination problem with multiple loops on the same page
- Can’t seem to get an else statement correct? [closed]
- Output ACF field dynamicaly within a taxonomy loop [closed]
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Query All Posts: Either Display Most Recent or One with Particular ACF Value Chosen