• I run the loop like this to exclude one category and show 5 posts in the frontpage.

    <?php query_posts('cat=-1&showposts=5'); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    ...
    <?php the_excerpt() ?>
    ...
    <?php endwhile; ?>

    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Next Entries »') ?></div>
    </div>

    <?php else : ?>

    <h2>Not Found</h2>
    Sorry, but you are looking for something that isn't here.

    <?php endif; ?>

    But the next_posts_link and previous_posts_link cannot correctly.I got 8 sample posts (1 post has been excluded),however,just one page shows up.

    Can anyone gimme a hand,if you want more details,I’ll post as more as possible.

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

The topic ‘next/previous posts link dont work in the loop’ is closed to new replies.