Support » Plugins » Hacks » Next/Prev Page _not_ Next/Prev Post

  • lmlm


    Hello everybody,

    I’m working on a website which uses WordPress pages exclusively (no posts). Is there a proper way to link the Next & Previous Page (not post)? Can anyone help with the right php code? How does the page order (as declared in the admin pages section) affect the code?

    I’ve been trying different bits of code found on the internet, however none of them seem to be working. I’ve even searched this forum, but ill i got was people referring to posts or pages of posts, which is not what i’m looking for.

    Thanks a lot!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Samuel B




    i have read and tried that many times, however since i am trying to put together a brand new theme, it doesnt work. i read it must be placed within the loop (i am using the default loop.php file from twentyten) and then the code in my sidebar is:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <p><?php wp_link_pages('before=<p>&after=</p>'); ?></p>
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    what am i doing wrong? thanks!

    Samuel B





    still no result, this:

    <p><?php wp_link_pages('link_before=&link_after='); ?></p>

    generates and empty paragraph:




    anyone, please can you help? my current code is

    <?php while ( have_posts() ) : the_post() ?>
    <p>1<?php wp_link_pages('link_before=&link_after='); ?>2</p>
    <?php endwhile; ?>

    and that just returns


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Next/Prev Page _not_ Next/Prev Post’ is closed to new replies.