I want to create an archive page template for WordPress that will look like this:
August 2009
- Post 4
- Post 3
- Post 2
- Post 1
July 2009
- Post 2
- Post 1
So, basically, I want all the posts from the blog, ordered descending by date and grouped by month.
Can someone provide me the PHP code for this?
Thanks!
PS: WordPress version is 2.8.2
This is a function I created a while back. It basically does what you want to do, but it’s not a template. Maybe you can adapt it.
I used the above function, but replaced the SQL query with:
This allowed me to use the excellent function @scompt.com wrote, but limit it to a single blog category.
Thanks a lot of the help. This is what I used with the code above.