WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] next / previous posts link in a single page (4 posts)

  1. agalberto
    Member
    Posted 5 years ago #

    I've read the other posts in the forum but i can't solve the problem.

    I'm trying to display a single posts in a single page with the navigation "next_post_link" and "previous_post_link()". But it seems not to work properly.

    This is the code i wrote

    <?php if (is_single()) : ?>
    <div id="navigation">
    <?php previous_post_link('%link', 'Previous post in category', TRUE, ''); ?> | <?php next_post_link('%link', 'Next post in category', TRUE, ''); ?></div>
    <?php endif; ?>

    It doesn't display the previuos link and the next link stops the navigation at the 2nd post.

    Can anybody help?
    Thanks
    Alberto

  2. esmi
    Theme Diva & Forum Moderator
    Posted 5 years ago #

    Are you using this code inside The Loop?

  3. agalberto
    Member
    Posted 5 years ago #

    Uhmm No, should i use it inside?
    I'll try. thanks

  4. agalberto
    Member
    Posted 5 years ago #

    Thats it. it worked! thanks thanks a lot ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic