When I need to list all the posts in 2011, grouped by month, I would do something similar in WordPress (quite simply, as described here ):
query_posts('monthnum=12&year=2011'); while ( have_posts() ) : the_post(); echo '<li>'; the_title(); echo '</li>'; endwhile;
Now, how to list all the messages and group them by months and years, not knowing how far I have to go back? That is, I do not know in which year the oldest post was set. Technically, I could try to make monthnum=12&year=2010 , monthnum=12&year=2009 , etc .; but I feel that there must be a better way.
source share