Automatically sorting items by year?

I have had several instances where I would like to display items like this:

2023

example 1/2023
example 2/2023
example 3/2023

2022

example 1/2022

2020

example 1/2020
example 2/2020

The current project is going to be sorting historical The Events Calendar events, but I’ve also had this issue with a date picker field (either post published date or ACF).

I can pull the items like so:

example 1/2023
example 2/2023
example 3/2023
example 1/2022
example 1/2020
example 2/2020

but is it possible to have a looper go through years that have these items, and then feed another looper to display all items in that year?

Hello Andy,

Thanks for writing in!

This may be possible by using the Looper Provider Query String where you will be using the Date (year) to display the items. I would like you to check out this video first as this should best describe it on how you can do it:

Kindly let us know how it goes.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.