Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Previous post and Next post links in post individual page #24

Open
alexvf opened this issue Nov 29, 2021 · 1 comment
Open

Previous post and Next post links in post individual page #24

alexvf opened this issue Nov 29, 2021 · 1 comment

Comments

@alexvf
Copy link

alexvf commented Nov 29, 2021

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.

@kruthoff
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants