I need to display all the months that have active posts, and inside each month I need to display at least 5 posts that are tied to each month.. the HTML will look like this:
News items
<h6>May</h6>
<ul>
<li><a href="#">Souvlaki ignitus carborundum</a></li>
<li><a href="#">Defacto lingo est igpay atinlay</a></li>
<li><a href="#">Quote meon an estimate</a></li>
<li><a href="#">Souvlaki ignitus carborundum</a></li>
<li><a href="#">Defacto lingo est igpay atinlay</a></li>
<li><a href="#">Quote meon an estimate</a></li>
</ul>
<h6>April:</h6>
<ul>
<li><a href="#">Sic tempus fugit esperanto hiccup</a></li>
<li><a href="#">Epsum factorial non deposit</a></li>
</ul>
Not sure how I can go about this or what function to use.. any help/direction would be appreciated.
one possibility is to run all posts through the loop and only output the month once per new month:
Here’s a more readable version of the solution provided by Michael