Published on May 1, 2020

[Condition] Post Inside Repeater is Prev / Next to Current Post

David Browne

Following on from the tutorial on how to visually build adjacent post links with the repeater component. In this members-only tutorial we'll go through adding a custom condition that allows us add elements based on if the post is either the previous or next post.

An example use case for this is if we wanted to be able to add different icons for arrows, where they will need to be different in each post. We could also use this to add different labels.

In our code snippets, the php to add the custom condition is the following;

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $499 one-time).

Already a member? Log in below or here.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-omagnifiercrossmenuchevron-downarrow-right