I don’t believe there’s a is_new_year()
function in WordPress, as an alternative for is_new_day()
. I’m trying to display the year only once for each set of posts, what would be the best way to do this?
Should I just check the date manually with PHP in the loop or are there any better ways?
You could create a helper function that returns a year number only once per year:
Then fetch your posts and use that helper: