Paginating wp_get_archives
-
Hi,
What would be the best way to to achieve this in a category-{slug}.php2013 | 2012 | 2011 | Previous
Shows all archives in {slug} and on year 2013.
I got the year links easily by passing ‘type’=>’yearly’ to wp_get_archives and restrict to specific category by using “Archives for a category” plugin but was unable to filter posts to year 2013 (I needed domain.com/2013/ instead of domain.com/category/slug) .
I did a pretty nasty hack (don’t know whether i can call it a hack) .. i made a custom WP_Query to work on current year and display posts of current category if the current url does have “slug” in it and if it doesn’t it will go with the usual archive loop …
Still I wasn’t able to get the pagination part working .Should i use a custom query to display years and do the pagination totally avoiding wp_get_archives() or is there any other way to do this
- The topic ‘Paginating wp_get_archives’ is closed to new replies.