I’m trying to use WP_Query to get all of a custom post type which contains a specific custom taxonomy.
I’ve tried the new and old styles and I can’t give it to give me what I want. It seems to basically be ignoring it completely, only using the post_type.
array('post_type' => 'my_type', 'tax_query' => array( 'taxonomy' => 'my_taxon', 'field' => 'slug', 'terms' => 'my_slug', 'operator' => 'IN');
array('my_taxon' => 'my_slug', 'post_type' => 'my_type')
and a few more. It just gives me all of the posts in that post type, not limiting them by the taxonomy.
- The topic ‘WP_Query with Custom Taxonomy’ is closed to new replies.