• I’ve searched but can’t seem to find a definitive answer. Can I exclude multiple categories using query_post?

    <?php
    if (is_home()) {
    $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    query_posts(“cat=-26&cat=-36&paged=$paged”);
    }
    ?>

    I read at another website that if I put the excluded categories into a parent category, I can exclude the parent and the children with one variable, but I would prefer not to do that.

Viewing 2 replies - 1 through 2 (of 2 total)
  • User:JamesVL/query_posts

    Looks like the issue maybe that if the post in question is included within another category, the post will be included.

    Thread Starter JaneLitte

    (@janelitte)

    drmike – I’ve looked at the link and that addresses only the exclusion of one category.

    I know that I could do it conversely – i.e., list all the categories to be <i>included</i> but it’s easier to exclude 2 categories than include 20.

    Are you saying, though,a s long as the post is marked with just one category, that the multiple category exclusion should work?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘excluding multple categories’ is closed to new replies.