Looper starting from current post

While viewing a post in a single layout, is it possible to create a looper showing the next three posts (offset 1-3)? I can’t figure out what my provider would be.

Thank you.

Hello @501creative,

Thank you for reaching out. I understand you would like a Looper on a single post layout that shows the three posts that come after the post currently being viewed. Offset will not do this, because it always counts from the start of the query, not from the current post. Instead, you can filter the query by the current post’s publish date. Please review the steps below.

  1. Set the Looper Provider to Query String – On the parent element (for example, a Row or Div), enable Looper Provider and set the type to Query String.

  2. Enter the query – For the next three (newer) posts, paste the following:
    post_type=post&posts_per_page=3&orderby=date&order=ASC&date_query[0][after]={{dc:post:publish_date format='Y-m-d H:i:s'}}
    For the three previous (older) posts, use this instead:
    post_type=post&posts_per_page=3&orderby=date&order=DESC&date_query[0][before]={{dc:post:publish_date format='Y-m-d H:i:s'}}
    The Dynamic Content tag inserts the current post’s date, so the query only returns posts published after (or before) it. The current post is left out automatically.

  3. Add the Looper Consumer and test – Turn on Looper Consumer on the child element that shows each post (for example, a Column or Card), and use {{dc:post:title}} / {{dc:post:permalink}} inside it. Preview a post in the middle of your archive to confirm three posts appear. On the newest or oldest post, fewer results will appear because there are no more posts in that direction.

Best Regards.