You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Afaik, the current template sorts the posts w.r.t their date field: the earliest is the first, the latest is the last.
I want to reverse that order (my latest posts should be the first ones to be displayed).
How can I achieve this?
The text was updated successfully, but these errors were encountered:
ozgunozerk
changed the title
How to sort posts in descending order instead of ascending w.r.t Date
How to sort posts in descending order instead of ascending w.r.t Date?
Jan 15, 2024
From what I've seen, there is no ordering. However, since the file name format for posts requires the date, posts are implicitly sorted (not via this template's code).
My current solution is to reverse the post list as such (maybe it will help others as well):
{% if include.show_posts %}
<div class="container animate">
<div class="row" data-pagebreak="6">
{% assign reversed_posts = site.crypto | reverse %}
{% for post in reversed_posts %}
{% bookshop blog-card post=post %}
{% endfor %}
</div>
</div>
It seems like a hacky solution, but if there is no better way, feel free to close this issue.
Afaik, the current template sorts the posts w.r.t their
date
field: the earliest is the first, the latest is the last.I want to reverse that order (my latest posts should be the first ones to be displayed).
How can I achieve this?
The text was updated successfully, but these errors were encountered: