Hello, I am trying to sort blog articles on a single page by year.
The second example linked here seems to work perfectly well, however, instead of the current year $year = date('Y'); I would like to use the range of years from the blog articles’ date fields.
Is this something someone may be able to help me learn how to do? Thank you.
I think you’re right—that I’d like to sort them rather than filter. This example is probably closer to what I’m after. I’m hoping to make a kind of list or index for each year so that all of the 2022 articles are together, the 2021 articles are together, and so forth.