WordPress.org

Forums

Displaying next and previous posts in relation to the post being viewed (2 posts)

  1. jbtank1
    Member
    Posted 7 years ago #

    On my single.php page I'm displaying 2 loops - one for the primary post and another which secondary loop which displays excerpts of 3 other posts. This is done chronologically on the homepage (as it should), but on the single.php page I want the secondary posts to be relative(and previous) to the primary post on this page (not chronological, necessarily).

    In other words, I want a loop of the 3 previous excerpts to be showing on the single.php pages.

    I'm using 'offset' on the homepage, but I don't know how to get it to work any other way than chronologically. Many thanks!

  2. jbtank1
    Member
    Posted 7 years ago #

    Another solution would be fine with me would be to display based on the post ids, but I'm not sure how to do that either.

Topic Closed

This topic has been closed to new replies.

About this Topic