What I am trying to do:
Showing posts, segmented by year and month in relation to when they are posted.
I am very close to that goal. I just need to sort the months in an descending order, so that the newest posts are effectively at the top. Since, you know, time is linear and such.
This is where I am at:
But, I just cannot figure out how to sort the months. I assume this is because it is an attribute loop (or loop without a type).
Here is a basic version of my current code:
<Loop type=calendar_year from=2021 to=current sort_field="year" sort_type="number" sort_order="desc">
<Date all_locale=da_DK />
<h1><Field year /></h1>
<Loop field=month> // <--- this is where I need some sorting to happen
<Field name />
<Loop type="post" publish_month="{Field month}" publish_year="{Field year}" orderby=date order=desc>
<Field title />
</Loop>
</Loop>
</Loop>
The above code produces the following output, where a demo post is shown:
What is the smartest way to do this?
Cheers