Support » Fixing WordPress » Exclude Categorys from posts loop

  • I have multiple categories and i want to exclude 2 of them. My problem comes when I go to the next page of posts. All of the following lines will exclude the categories but only on the first page of post results.

    when i use the following line my ‘next page’ link go no where, it goes to the same page i click from.

    <?php query_posts(‘cat=-17,-36’); ?>

    when i use the following line my ‘next page’ link go no where, it goes to the same page i click from. using home.php

    <?php if ( is_home() ) {query_posts(‘cat=-17,-36’); } ?>

    when i use the following line my ‘next page’ link goes to the next page but the categories are not excluded.

    <?php if ( is_home() && !is_paged() ) { query_posts(‘cat=-17,-36’); } ?>

    im looking to exclude these categories through out my regular posting not just on the first page.

    Im putting these lines right before the loop. like this

    <?php if ( is_home() && !is_paged() ) {query_posts(‘cat=-17,-36’); } ?>
    <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>

    ??? anyone…

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exclude Categorys from posts loop’ is closed to new replies.