• H, I’m trying to set up a page that shows all my blog entries. I have the code below and it works fine, except the ‘next / prev’ links link to the same content. The address is still blog/page/2/, blog/page/3/ etc… but the posts are always the same latest five.

    <?php query_posts(‘showposts=5’); ?>
    <?php while(have_posts()) : the_post() ; ?>

    “><h2><?php the_title(); ?></h2>
    <!–<?php the_excerpt(); ?>–><?php the_content(); ?>

    <p class=”postmetadata”>Posted in <?php the_category(‘, ‘) ?> | <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
    <?php endwhile; ?>

    <div class=”alignleft”><?php next_posts_link(‘« Older Entries’) ?></div>
    <div class=”alignright”><?php previous_posts_link(‘Newer Entries »’) ?></div>

    Any help would be GREATLY appreciated. Many thanks in advance.

Viewing 1 replies (of 1 total)
  • This is because you use query_posts.
    You have to use a “hack” to fix it if you want to keep using query_posts.

    But in the above code i can’t see a reasen why you shoudn’t use the wordpress loop wich is the defealt. Then your prev and next buttons will work.

    Greetz,

    Durgé
    Dimics.com

Viewing 1 replies (of 1 total)
  • The topic ‘Archive posts page and next/prev links: Help Please!!’ is closed to new replies.