[wp-hackers] Custom Taxonomy WP_Query for All Terms in a Taxonomy

Mike Schinkel mikeschinkel at newclarity.net
Sat Nov 6 01:52:34 UTC 2010


Dave,

I think this is what you need?   https://gist.github.com/665119

-Mike


On Nov 5, 2010, at 6:45 PM, David Morris wrote:

> Is there an easy way to query for any posts that is tagged with any term
> from a particular taxonomy?
> 
> I know this technique:
> 
> $custom_taxonomy_query = new WP_Query(
> array(
> 'taxonomy_name' => 'term_slug',
> )
> );
> 
> But I would like to either pass a wildcard in place of term_slug, or perhaps
> just an empty string. Then that would give me all posts that are tagged by
> any term in that taxonomy, not just one specific term.
> 
> Thanks for your help,
> Dave
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list