Title: WP_Query empty when using tax_query
Last modified: August 22, 2016

---

# WP_Query empty when using tax_query

 *  Resolved [coderdj412](https://wordpress.org/support/users/coderdj412/)
 * (@coderdj412)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/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)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/wp_query-empty-when-using-tax_query/#post-5489493)
 * I’m not seeing any issues in your query. It’s sort of retarded but you could 
   probably place each term argument in it’s own taxonomy array to avoid arrays 
   passed to ‘terms’.
 * But there’s no reason you should need to do that. Try hooking the ‘posts_request’
   filter to examine the resulting SQL query. Something’s wrong with how it’s built,
   what that is could be a clue to a solution.
 *  Thread Starter [coderdj412](https://wordpress.org/support/users/coderdj412/)
 * (@coderdj412)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/wp_query-empty-when-using-tax_query/#post-5489531)
 * For some reason I must have switched the syntax and it wasn’t an array of an 
   array and that’s why it wasn’t working. Finally fixed it and now its working.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WP_Query empty when using tax_query’ is closed to new replies.

## Tags

 * [query](https://wordpress.org/support/topic-tag/query/)
 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [coderdj412](https://wordpress.org/support/users/coderdj412/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/wp_query-empty-when-using-tax_query/#post-5489531)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
