• adamohern

    (@adamohern)


    I’ve actually got two related questions, so thanks in advance for your help:

    Part 1)
    I’m currently using the following query:
    $args = array('category__and' => array($cat1,$cat2), 'showposts' => 20 );
    I would now like to EXCLUDE posts from a certain category, but adding a ‘category__not’ seems to negate the ‘category__and’. Is there a way to do both in a single query?

    Part 2)
    What if I want to make a category link that would take me to a list of posts including multiple categories, but excluding others (same as above, but without the custom query_posts template tag)?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘query posts with 'cagetory__and' AND 'category__not'?’ is closed to new replies.