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

William Davis will.davis at gmail.com
Sat Nov 6 00:10:48 UTC 2010


Dave,
I haven't tested this, and it's a bit old, but it might work: http://stackoverflow.com/questions/1155565/query-multiple-custom-taxonomy-terms-in-wordpress-2-8

William P. Davis
will.davis at gmail.com
207.660.5342
http://twitter.com/williampd
http://www.wpdavis.com



On Nov 5, 2010, at 7:29 PM, wp-hackers-request at lists.automattic.com  
wrote:

> Otto,
>
> I think you're right, I am unable to pass anything other than a  
> string to
> the taxonomy piece of WP_Query in 3.0.1
>
> Dave
>
>
>
> On Fri, Nov 5, 2010 at 5:56 PM, Otto <otto at ottodestruct.com> wrote:
>
>> You could call get_terms to get the terms, then run the query for all
>> those terms.
>>
>> You might need 3.1 to do this multiple-term query thing. Dunno.
>>
>> -Otto
>>
>>
>>
>> On Fri, Nov 5, 2010 at 5:45 PM, David Morris <dvmorris at gmail.com>  
>> 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
>>>
>> _______________________________________________
>> 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