[wp-hackers] Query Taxonomy in Pages

Devin Dixon devin at tayloegray.com
Mon Aug 9 18:05:34 UTC 2010


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?


More information about the wp-hackers mailing list