WP_Query empty when using tax_query
-
I am attempting to query a couple taxonomies via a custom post type: venues.
Using the example, I came up with this query but, it comes up empty:
$args = array( 'post_type' => 'venue', 'tax_query' => array( array( 'taxonomy' => 'venue_type', 'field' => 'slug', 'terms' => array('bar', 'club'), ), ), ); $query = new WP_Query( $args );
But, if I use this, I get results:
$args = array( 'venue_type' => 'bar', // Will not accept arrays and I need multi ); $query = new WP_Query( $args );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘WP_Query empty when using tax_query’ is closed to new replies.