I have the following query setup to pull videos from a custom post type by category:
$cat_name = single_cat_title('', FALSE); $videos = new WP_Query(array( 'post_type' => 'video', 'tax_query' => array( array( 'taxonomy' => 'category', 'field' => 'name', 'terms' => $cat_name ) ), 'orderby' => 'date', 'post_status' => 'publish', 'order' => 'DESC', 'posts_per_page' => -1 ));
When I echo the $cat_name variable, I'm getting the correct category name. However, when I output the request for the query, what I'm getting is:
SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND ( 0 = 1 ) AND wp_posts.post_type = 'video' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC
With no reference to the tax_query.
Can anyone see what I'm doing wrong that is not triggering the tax query portion of the query?