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

  1. agalberto
    Posted 6 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?

  2. esmi
    Forum Moderator
    Posted 6 years ago #

    Are you using this code inside The Loop?

  3. agalberto
    Posted 6 years ago #

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

  4. agalberto
    Posted 6 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic