[wp-hackers] Query Taxonomy in Pages

Eric Mann eric at eamann.com
Mon Aug 9 18:23:35 UTC 2010


Just a hunch, but I'd try:
 
'page-tags__in' => array()
 
using the ids of the tags, not the slug ... based on the documentation here:
http://codex.wordpress.org/Template_Tags/query_posts#Tag_Parameters

On August 9, 2010 at 6:05 PM Devin Dixon <devin at tayloegray.com> wrote:

> Hey all,
>
> I am trying to query pages based on taxonomy. The pages have a custom
> taxonomy called 'page-tags' . The followings arguments work when
> passed into  WP_Query().
>
> $args=array(
>   'page-tags' => 'basic tag' ,
>   'post_type' => 'page',
>   //'post_status' => 'publish',
>   //'posts_per_page' => -1,
>   'caller_get_posts'=> 1
> );
>
> This will pull all the pages with the tag 'basic tag', it works. Now
> the problem comes into play when I try to add in more than one tags.
> For example:
>
> $args=array(
>   'page-tags' => "basic tag, 2nd tag" ,
>   'post_type' => 'page',
>   //'post_status' => 'publish',
>   //'posts_per_page' => -1,
>   'caller_get_posts'=> 1
> );
>
> Then nothing is return in the query.  i've also tried using
> 'page-tags' => array('basic tag', '2nd tag')
>
> and that still doesn't work. So my question is, how can I use an OR
> for the taxonomy?
> _______________________________________________
> 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