Support » Themes and Templates » Custom page template previous/next links don't work

  • Resolved annehill


    I had someone create a custom page template for a category archive. One thing has never worked on it though: if you try to navigate to the 2nd or 3rd page of archives, it keeps calling the same (most recent) page. So all my previous podcasts (that’s the post category) are essentially hidden from view.

    Here’s the navigation part of the page template:

    <div class="navigation">
    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
    <div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div>
            <div class="alignright"><?php previous_posts_link('Next Entries »') ?></div>
            <?php } ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

    And here’s the actual link on my site:

    Anyone know what the nav is missing?


Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael


    Forum Moderator

    the cause is usually not the ‘next/prev’ code, but something at the start of the loop;

    can you paste the full code of the template into a and post the link to it here?




    Sure, thanks for that. Here’s the link:



    Forum Moderator

    try and add the ‘paged’ parameter to this line:

    <? query_posts('cat=3'); ?>


    <?php query_posts('cat=3&paged='.get_query_var('paged')); ?>

    or, if that does not work, try:

    <?php query_posts('cat=3&paged='.get_query_var('page')); ?>


    Fantastic–it works! Thanks so much.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom page template previous/next links don't work’ is closed to new replies.