Skip to main content
Tweeted twitter.com/StackWordPress/status/778755109455073280
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
deleted 34 characters in body; edited title
Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

Wordpress category Category specific months list in sidebar.php

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.

Wordpress category specific months list in sidebar.php

What have made me pulling my hair apart for while, how to output category specific month list. '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/) and the other is BLOG page(ex. http://xxxxxxx.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.

Category specific months list in sidebar.php

What have made me pulling my hair apart for while, how to output category specific month list. I'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://example.com/news/) and the other is BLOG page(ex. 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?

Source Link
norixxx
  • 365
  • 1
  • 3
  • 15

Wordpress category specific months list in sidebar.php

What have made me pulling my hair apart for while, how to output category specific month list. '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/) and the other is BLOG page(ex. http://xxxxxxx.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.