The problem is ambiguity, you can’t just put in 'relation' => 'OR' in the main parameter list, because how would WP_Query know if it’s for the tax_query and not the meta_query?
For how it’s supposed to work, and where the relation parameter goes we need to refer to the official docs for WP_Query which gives us this example:
$args = array(
'post_type' => 'post',
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => array( 'quotes' ),
),
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array( 'post-format-quote' ),
),
),
);
$query = new WP_Query( $args );
Setting it may be as simple as:
$myarray['relation'] = 'OR'; // untested
Related Posts:
- How to add custom meta to ‘pre_get_terms’?
- How to show terms from another taxonomy
- Why is my WP_Query not working when tax_query terms are an array?
- How to add terms to my tax_query based off of the current post
- Is it possible to dynamically get queried term AND taxonomy?
- Empty tax_query array returns an empty array
- How do I search inside specific taxonomies in WordPress
- Formulate a url to show posts with both taxonomy terms
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Order by slug in get_terms with multiple taxonomies
- Function get_queried_object() return NULL in custom taxonomy
- Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
- Get authors by term id or slug
- Slow queries on a huge database
- Taxonomy order exception for specific term
- Get posts from multiple tax terms
- How to Order a list of taxonomies? orderby?
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- Can’t get term id for category archive
- How to make a post with certain taxonomy term display first before other post with only one query?
- How can I order a post query’s results based on the number of matching taxonomy terms?
- Only show tag with the same id as the post
- Save queried result into database
- taxquery taxonomy get terms
- How to define a custom hierarchy for terms?
- How can I get all the posts that are related with a specific taxonomy term?
- How to get several fields from wp_query?
- Displaying Results From Custom Taxonomy Query
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
- Modify WordPress Search
- Wp get all the sub pages of the parent using wp query
- Show posts without term
- Usage of the new “posts_clauses” filter in WordPress 3.1?
- Search custom taxonomy term by name
- How to display post from current Taxonomy in archive page?
- Get posts by meta data OR title
- WP_Query ordered by custom field that is a date string?
- Duplicate Queries
- How to count post type that has a particular term?
- Foreach-generated custom tax queries, each with an ajax “Load more” button
- WP_Query Performance Issues with meta_query
- Query Set Order By Author
- Get taxonomy terms only of the WP_Query current posts
- if/else on custom query gives 200 OK when condition not met?
- How to correctly pass values to wpdb->prepare()?
- Setting get_queried_object
- remove query arg from url after set query
- difference between like ‘%%%var%%’ and ‘%var%’
- List custom taxonomy terms sharing posts with a term from a second custom taxonomy
- Sort query by author: 1 author, then others
- Overwrite YoastSEO meta-tags with another page’s [closed]
- How to orderby multiple meta fields if some fields are empty
- How to duplicate 5 posts out of WP_Query results?
- WP Query Args – Title or Taxonomy Value
- WP_query sorting can’t sort danish letters (æ, ø, å)
- Multisite pagination issue by multi query archive 404
- Query with relation and one without relation using multiple taxonomies?
- wp_query args adding muitiple tax_querys
- Automatically Query Parent Taxonomy
- Query only the posts with a post format of “audio”
- pre_get_posts – Trying to get property of non-object warning
- WordPress query posts with multiple post_meta data
- Update query for wp_posts and wp_postmeta
- How to print term name inside wp post loop
- Loop posts based on permalink term
- Using WP_Query for categories instead of get_terms
- Grabbing taxonomy terms and inserting them into an array
- Write WP Query that selects posts that are part of the same two categories
- Insert images into wordpress post with a query
- WP_Query meta compare must include ALL array values
- Strange behaviour of hierarchical taxonomy archive
- WP Query by 4 different taxonomies
- pre_user_query vs pre_get_posts
- wp_query with meta_query and tax_query
- Doing $wpdb->get_results returns NULL, doing the same query in my DB returns correct value
- Adding nofollow to all the post links in get_posts with pre_get_posts or WP_Query
- Meta query orderby meta_value_num sorting by role first
- Add to search posts query array with post IDS which will appear first
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- pages shortcode filtering by category
- get term objects and post objects in query
- My entry results are not consistently alphabetized
- Ignoring ‘a’ when sorting posts
- Custom query for tag and custom tag from 2 post type
- wpdb get_results() returns only 2 rows
- WP_Query secondary query failing
- No results for taxonomy archive page
- Search format not matching taxonomy query
- Search Functionality broken by the wp 4.2 update
- Issue attempting a wp_query_posts with tags
- add_query_vars does not work
- Retrieve posts in custom post type and specific taxonomies
- Get the number of rows from $wpdb->get_results not working
- Get Child Custom Post Content on Single.php?
- How much does $wpdb->prepare(), then $wpdb->query() VS straight $wpdb->query(), can slow down the load time of whole page
- Pre_get_post on CPT archive page
- Get posts that were most recently tagged
- I need to get all categories from a WP_Query
- How to get posts that have certain meta key value and order based on another meta key’s value
- Custom tag template to list posts in ASC order