• Hello,
    I have this code and I want to exclude certain categories to be exluded.

    <?php
    query_posts(“cat=”.$singlecatid);
    $i=0;
    while (have_posts()) : the_post();

    if($i % 2 == 0) $alt = ‘odd’;
    else $alt = ‘even’;
    $i++;

    ?>

    Thanks

Viewing 1 replies (of 1 total)
  • I’m confused–assuming $singlecatid has a value then the query_posts is only returning the posts from one category. Right?

    Resources:
    Exclude Posts From Some Category

    But if I missed the question, maybe you are needing something like:

    $cat = get_query_var('cat');
    query_posts('cat=' . $cat);

Viewing 1 replies (of 1 total)
  • The topic ‘Exclude category in loop’ is closed to new replies.