• fernipascual

    (@fernipascual)


    I tried adding ‘Previous Post’, “next Post’ to my blog posts but could not make it work. Your help will be much appreciated.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • pattyok

    (@pattyok)

    Hi fernipascual. The first thing to check is to look in your WordPress settings to see how many posts are set to show at a time.

    Go to WP Admin > Settings > Reading Settings. If it is set to 10 and you only have a total of 8 posts, the prev/next links will not display.

    Try setting it to less than 8 and see if they show up.

    If you do indeed have more posts, you will need to add the prev/next tags to the bottom of your single template. Something like this should do the trick…

    <div class="post-nav">
            <div class="post-nav-prev">
            <?php previous_post_link('%link', 'Previous Post'); ?>
            </div>
            <div class="post-nav-nex">
            <?php next_post_link('%link', 'Next Post'); ?>
            </div>
        </div>

    More information on the previous_post_link tag can be found here: previous_post_link

    Thread Starter fernipascual

    (@fernipascual)

    Thanks. That fixed something that hadn’t hit my radar. I only have 8 posts, so I changed that to seven and it added two squares with the numbers 1 and 2. I learned something new today!

    The posts are set to display as summaries in the Blog page with a ‘Read More’ button. I want to add ‘Next’ and ‘Previous’ to the actual post.

    So, once you press on ‘Read More’ and takes you to to a post, I want users to be able to navigate to the following/previous post without having to go back to the ‘Blog’ page.

    Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add Pagination to Blog Posts’ is closed to new replies.