WordPress.org

Ready to get started?Download WordPress

Forums

Put next/previous post links at Top of page (2 posts)

  1. table4five
    Member
    Posted 6 years ago #

    My blog is Table for Five. I would like to add navigation links to my previous and next posts at the top of the single post page. I searched here and found this code:

    <div class="navigation">
    <div class="alignleft"><?php previous_post('« %','','yes') ?></div>
    <div class="alignright"><?php next_post(' % »','','yes') ?></div>

    I can get it to work when I insert it into single.php at the bottom just above <?php get_footer(); ?>, but when I try to put it at the top just under <?php get_header(); ?>, the links don't appear. Am I putting the code in the wrong place? Or is there something else I'm missing? Thank you!

  2. harknell
    Member
    Posted 6 years ago #

    You'll probably want to put it right after the div id=content tag so that it shows up in the main part of the page.

Topic Closed

This topic has been closed to new replies.

About this Topic