Last active
August 5, 2022 19:16
-
-
Save coryetzkorn/c0bb2192d0c7dc9ddc3af21226afe4e6 to your computer and use it in GitHub Desktop.
Craft CMS Prev / Next Entries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set prevSibling = craft.entries().prevSiblingOf(entry).one() %} | |
{% set nextSibling = craft.entries().nextSiblingOf(entry).one() %} | |
{% set prevEntry = prevSibling ? prevSibling : craft.entries().section('work').inReverse().one() %} | |
{% set nextEntry = nextSibling ? nextSibling : craft.entries().section('work').one() %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment