WordPress.org

Ready to get started?Download WordPress

Forums

"Previous Entries, Next Entries" code not working (4 posts)

  1. Anonymous
    Unregistered
    Posted 5 years ago #

    I'm using V2.6.

    The code on my index.php template looks like this:

    <div class="alignleft">
    <?php next_posts_link('« Previous Entries') ?>
    </div>

    <div class="alignright">
    <?php previous_posts_link('Next Entries »') ?>
    </div>

    But the rendered page code in the browser looks like this - like the php code has been ignored, and no links show:

    <div class="prevnext">
    <div class="alignleft"></div>
    <div class="alignright"></div>
    </div>

    Any help?

  2. Roy
    Member
    Posted 5 years ago #

    I'm not sure, but I think you might want to replace the >>'s by raquo's (the code of the image).

  3. Anonymous
    Unregistered
    Posted 5 years ago #

    Sorry - that's how it came out when I cut and pasted it into this forum.
    My code does have the proper &laquo code rather than the << but it's not working.

  4. patrickdappollonio
    Member
    Posted 5 years ago #

    You need to put a ";" between the ) and ? in the code, and you need to pass the "%link" to the function and then the text that you like to show.

    Like this:

    <?php next_posts_link('%link', '« Previous Entries'); ?>
    <?php previous_posts_link('%link', 'Next Entries »'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic