I’ve been pulling my hair out on this one – I need to hard code in wp_get_archives()
for a specific category into a template.
This post was useful:
but, as with all the plugins I’ve found so far, they don’t work with WP 3.1 (or you need to hack the core files which I obviously don’t want to do).
Is there another solution I’m not aware of? Maybe a method by creating a separate loop?
THanks for any pointers
osu
I did this in a relatively complicated way using a custom query. I did not know about Smart Archives Reloaded so I wrote code myself. But it works. Replace your category ID for “term_taxonomy.term_id”
Writing this I was helped by looking at http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/general-template.php where wp_get_archives is defined.
And used the code found here (put in functions.php):
http://snipplr.com/view.php?codeview&id=17432
to create permalinks for archives for one category in the form of
http://example.com/category_base/category_name/date/YYYY/MM
Take a look at Scribu’s Smart Archives Reloaded plugin
which allows you to display a list of posts grouped by year and month.
And to limit the archives by category is as simple as this:
Perhaps use query_posts to generate your query and then use a custom loop.
http://codex.wordpress.org/Function_Reference/query_posts