Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need to generate a list of years and months belonging to a category. For example I have two main categories (A and B). I need a list of years and months of post published only of the category A and a similar list but the category B.

With the following structure:

<ul>
    <li>
        <a href="#">2014</a>
        <ul>
           <li><a href="#">March</a></li>
           <li><a href="#">February</a></li>
           <li><a href="#">January</a></li>
        </ul>
    </li>
    <li>
        <a href="#">2013</a>
        <ul>
           <li><a href="#">December</a></li>
           <li><a href="#">November</a></li>
           <li><a href="#">October</a></li>
        </ul>
    </li>
</ul>

I try with this function I found in this answer to a similar question to mine (Archive list with only years and months), but I confess that the search in MySQL are not my strong suit and I could not take the extra step for filtering the results by category. I'd be very grateful if you could help me out to achieve this. Of course I am very grateful for the time you can devote to this question.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.