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

  • Resolved annehill

    (@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 } ?>
    			</div>

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

    And here’s the actual link on my site:

    http://annehill.org/dream-talk-radio/podcasts/

    Anyone know what the nav is missing?

    Thanks,
    Anne

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

    (@alchymyth)

    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 http://pastebin.com/ and post the link to it here?

    how-to

    annehill

    (@annehill)

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

    http://pastebin.com/gZrxGYQR

    Michael

    (@alchymyth)

    Forum Moderator

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

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

    example:

    <?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')); ?>
    annehill

    (@annehill)

    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.