Pico-Pagination icon indicating copy to clipboard operation
Pico-Pagination copied to clipboard

Previous post and Next post links in post individual page

Open alexvf opened this issue 3 years ago • 1 comments

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.

alexvf avatar Nov 29 '21 11:11 alexvf

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.

kruthoff avatar May 28 '22 14:05 kruthoff