Support » Themes and Templates » Older Entries and Newer Entries Show Same Posts

  • I’ve created my own theme. We have 5 different categories of posts. I’m trying to create a page that lists all the older posts for one particular category. Basically, an archives page for this category. I have created a new “page” in WordPress and created a “template” page for this page to use. In my template page I use the code below to find all the “dailydiversion” postings and display the title and the date. It works fine. The only problem is when you click on the “Older Entries” or “Newer Entries” links at the bottom it still shows the same 10 posts. There are currently 26 posts for this category and WordPress seems to know this, as it builds 3 pages, but each page shows the same 10 posts. Here’s a link to the page in question: Any help with what I’m doing wrong would be greatly appreciated. Thank you very much.

    ‘ <?php query_posts(‘category_name=dailydiversion’); ?>
    <?php if (have_posts()) : ?>

    <h2 class=”posttitle”>Daily Diversion Archives</h2>
    <?php while (have_posts()) : the_post(); ?>
    <div class=”post”><h3 id=”post-<?php the_ID(); ?>”>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?> – <span class=”thedate”><?php the_date(‘n.j.y’) ?></span></h3>
    </div><!– post div ENDS here –>
    <div class=”searchdivider”><img src=”” alt=”” width=”339″ height=”1″ /></div><!– searchdivider div ENDS here –>
    <?php endwhile; ?>

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

  • The topic ‘Older Entries and Newer Entries Show Same Posts’ is closed to new replies.