Pico-Pagination
Pico-Pagination copied to clipboard
Previous post and Next post links in post individual page
Is it possible, using the plugin as is, to have two links for the previous and next posts in the individual post page? Something like this below the post's content: | << Previous post title | Next post title >> |
I've done it like this but the order is all messed up. Seems to be sorted alphabetically instead of sorted by date:
{% if prev_page.title %}
<span class="prev-post">
<a href="{{ prev_page.url }}" rel="prev">{{ prev_page.title }}</a>
</span>
{% endif %}
{% if next_page.title %}
<span class="next-post">
<a href="{{ next_page.url }}" rel="next">{{ next_page.title }}</a>
</span>
{% endif %}
Thanks in advance for your help.
Sorting can be configured in config.yml
Change pages_order_by: alpha
to pages_order_by: date
, and you'll get the prev and next page link.