SQL request with WP_Query, join OR between post_type and taxonomy
-
Hi.
My issue is pretty simple, I’m trying to get both portfolio posts (plugin) and articles that have the “portfolio” category (made myself).
$args = array( 'post_type' => 'portfolio', 'tax_query' => array( array( 'taxonomy' => 'category', 'field' => 'slug', 'terms' => 'portfolio', ) ) ); $query = new WP_Query($args);It looks like the relationship between post_type and tax_query is an AND, I’d need an OR, how can I do that?
I tried following the official documentation but I’m stuck. (https://codex.ww.wp.xz.cn/Class_Reference/WP_Query)
Thanks for the help.
The topic ‘SQL request with WP_Query, join OR between post_type and taxonomy’ is closed to new replies.