Group wordpress posts by date

26 Apr 2013

I am working on a WordPress website that has a marketplace (similar to Craigslist) and an “announcements” section and I wanted to have the entries in these two sections grouped by date. Here’s how it should look:

announcements section with posts grouped by date posted

And here’s the code: