Hi, I am I want to make the next news part, if the user is in the first post, it should show the next post, if the user is in the last post, it should show the next post. Otherwise it should always show the next post.
The code I found in the documentation did not fully meet my needs:
And I tried something like this:
How can I tell if the post is the first or the last?
Not tested, but I’d try something like
{{#next_post}}
{{#if url}}
– do all the stuff you want to do if the post exists
{{/if}}
{{/next_post}}
That way you get into the next post context if it exists, then check that the url exists in that context, because if it doesn’t, you don’t want to render that section anyway.
If that doesn’t meet your needs, please post more about what you’re trying to do?