Multiple taxonomy query not working
-
Hi there,
I added a taxonomy to pages using CPT UI (‘page-categories’). I have the following loop:
$args = array( 'post_type'=> array('post','page'), 'showposts' =>5, 'post_status'=>'publish', 'tax_query' => array( 'relation' => 'OR', array( 'taxonomy' => 'category', 'field' => 'id', 'terms' => array(118) ), array ( 'taxonomy' => 'page-categories', 'field' => 'id', 'terms' => array(148) ) ) ); query_posts($args);
The first array inside of ‘tax_query’ is querying the posts with a particular ID, the second, the pages with a particular ID. For whatever reason, it’s not loading both taxonomies even though a post exists for each. If I remove the post array, the page array shows. However, if I leave it like it is (above), the pages never show. Any thoughts here?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Multiple taxonomy query not working’ is closed to new replies.