I have two categories on a site – news which contains news posts and blog – which contains blog posts. Each page has a wp_get_archives in the sidebar. I’d like to limit the archive listing by category but after looking at the codex this does not seem possible. http://codex.wordpress.org/Function_Reference/wp_get_archives

<?php wp_get_archives('type=monthly&limit=12'); ?>

That code lists the archives for all the posts, but I want to list archives for just that category. Am I using the wrong function? Or is this not possible?

4 Answers
4

Basically this is possible, but somewhat messy. This function relies on direct SQL query to database, which you can change via getarchives_where and getarchives_join filters.

Leave a Reply

Your email address will not be published. Required fields are marked *