How can I order posts in collection by the published date? #7685
-
I am using {{ collection:posts orderby (published_at 'desc') }}
...
{{ /collection:posts }} But unfortunately, this is not working. How can I resolve this? |
Beta Was this translation helpful? Give feedback.
Answered by
duncanmcclean
Mar 11, 2023
Replies: 1 comment 1 reply
-
What you're doing would probably work if you were doing it on an array but Maybe try this instead: {{ collection:posts sort="published_at:desc" }}
<!-- ... -->
{{ /collection:posts }} You can review the Statamic documentation to see what parameters are available for the Collection tag. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dasundev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What you're doing would probably work if you were doing it on an array but
collection:posts
is a tag.Maybe try this instead:
You can review the Statamic documentation to see what parameters are available for the Collection tag.