What have made me pulling my hair apart for while, how to output category specific month list. 'veI've been searching for the same problem and solution cannot find any lucky so far...
Anyway, I have two POST type pages in my web site.
One is NEWS page(ex. http://xxxxxxx.com/news/http://example.com/news/
) and the other is BLOG page(ex. http://xxxxxxx.com/blog/http://example.com/blog/
).
I use archive.php
to show my NEWS and BLOG page and where I want to output month list with post counts in sidebar.php
.
I could output lists by using wp_get_archives('cat=0')
however this outputs like this
2013/05(20)
2013/06(12)
2013/07(18)
2013/08(6)
HTML:
<li><a href="http://xxxxxxxx.com/wp/2013/05/"></a></li>
<li><a href="http://xxxxxxxx.com/wp/2013/06/"></a></li>
<li><a href="http://xxxxxxxx.com/wp/2013/07/"></a></li>
<li><a href="http://xxxxxxxx.com/wp/2013/08/"></a></li>
When I click one of these, this takes me to the page where all the posts happened in that specific month, of course.
What I'd like to output if I am in NEWS page for example is:
HTML:
<li><a href="http://xxxxxxxx.com/wp/news/2013/05/"></a></li>
<li><a href="http://xxxxxxxx.com/wp/news/2013/06/"></a></li>
<li><a href="http://xxxxxxxx.com/wp/news/2013/07/"></a></li>
<li><a href="http://xxxxxxxx.com/wp/news/2013/08/"></a></li>
Category specific. Any idea?
My Wordpress ver.: 3.6.x
Thanks.