[wp-hackers] advanced taxonomy queries

Haluk Karamete halukkaramete at gmail.com
Fri Dec 21 04:04:03 UTC 2012


In this query, we get the posts in the foo cat OR the bar cat

$myquery['tax_query'] = array(
    array(
        'taxonomy' => 'category',
        'terms' => array('foo', 'bar'),
        'field' => 'slug',
    ),
);
query_posts($myquery);

how do we change in the above snippet it so that we get the posts that
are in both categpories? That is both in the foo cat *AND* in the bar
cat?


More information about the wp-hackers mailing list