Add wraparound (next or first / previous or last) capability to Dynamic context and next / prev. post actions

When using a dynamic context to display previous or next post data, this works really well, except in the cases of the first and last posts.

Currently there is no built-in condition for us to check whether it is the first or last post to be able to hide the blocks displaying the next post data/link, so the next best solution would be to display the first post when there is no more next post to retrieve.

Here is an example of how this looks in code.

Thank you!

There is a creative (and slightly hacky) workaround for this using the dynamic context.

Following on from the workaround I posted regarding Has Next/Prev. Post conditions, you can also add a second div with opposite display conditions and nest in it a query that displays the first post.

Screenshot 2023-03-28 at 22.51.39

Screenshot 2023-03-28 at 22.55.27
Screenshot 2023-03-28 at 22.56.27

This emulates the wraparound behaviour perfectly until this becomes a built-in feature.