Forums

next previous post problem (7 posts)

  1. sailpilot
    Member
    Posted 3 years ago #

    We have a problem with the display of the next and previous post links.

    The links displayed are not for the next or previous posts but other ones. When clicking on a post title, that post is displayed on a single page with the next/previous links at the top. But they are incorrect.

    This is the code we use.

    <?php previous_post_link('Previous Post: %link','%title',TRUE); ?> <?php next_post_link('Next Post: %link','%title',TRUE); ?>

    anyone have an idea of why this is not working correctly.

  2. asechrest
    Member
    Posted 3 years ago #

    You have the in_cat argument set to TRUE, meaning the links will cycle only to posts in the same category as the one you're on.

    Remove that argument.

  3. sailpilot
    Member
    Posted 3 years ago #

    I tried it. It didn't work.

    also this is not a retrieval by category.

  4. asechrest
    Member
    Posted 3 years ago #

    Elaborate on "it didn't work."

    Retrieval by category has nothing to do with it.

    Link the page on your site and paste your code in a pastebin and link it here if you can.

  5. sailpilot
    Member
    Posted 3 years ago #

    What I meant by it didn't work is that it still does the exact same thing as before even when the TRUE is removed. It retrieves posts but not the next or previous posts.

    I can't link the page right now. We are working on something for a client. Sorry.

  6. asechrest
    Member
    Posted 3 years ago #

    Is this in single.php? Can you paste the code?

    Can you determine any correlation between the posts it IS cycling to? Are they all in the same category?

  7. sailpilot
    Member
    Posted 3 years ago #

    sorry. I made a mistake. The removal of TRUE did fix the problem. I saved the updated file into the wrong local directory and wasn't uploading the latest version..

    Thanks for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags