WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have archive links in my theme that get the archives for a specfic category ('blog) like so:

 <?php wp_get_archives('cat=6'); ?>

When i click on the link for the archives is just loads the category page again for the blog.

The url does change to:


But nothing changes on the page.

share|improve this question
That is an odd mix of pretty permalinks and default (straight PHP) permalinks. What setting do you have in wp-admin->Settings->Permalinks? – s_ha_dum Nov 7 '12 at 15:03
/%category%/%postname%/ – Chris Nov 7 '12 at 15:04
Which field? "Custom Structure"? Does other URL rewriting work? What is the server (Apache, IIS, etc.) what is the OS of the server? – s_ha_dum Nov 7 '12 at 15:08
custom structure, server is apache and linux. On my category page I have it split with if statements to show the posts different depending if its in the blog section or work section. I wonder if this has something to do with it. But i cannot find where the archive code is. – Chris Nov 7 '12 at 15:11

OK. Here is your problem.

wp_get_archives( $args );
$args = array(
    'type'            => 'monthly',
    'limit'           => ,
    'format'          => 'html', 
    'before'          => ,
    'after'           => ,
    'show_post_count' => false,
    'echo'            => 1

You are use wp_get_archives incorrectly. That function accepts particular 'keys', and cat isn't one of them. You can use an array as above or the weird get-like string that is common in WordPress. You can't pass it values it isn't meant to handle though.

What you are seeing is the function fall back to its 'monthly' archive default, and apparently append your string to the end, which I wouldn't have expected.

Use get_category_link instead.

share|improve this answer
Ok, This has now started to work. But, how would I get archives from a certain cat? – Chris Nov 7 '12 at 15:27
Use get_category_link; see my answer. – s_ha_dum Nov 7 '12 at 15:29
Ok, but how can i filter these monthly? – Chris Nov 7 '12 at 15:31
I don't know of a function that will do that. Of course you can start filtering WP_Query – s_ha_dum Nov 7 '12 at 15:38
Sorry, what i mean is, when I click 'October'. How do i see all the posts from October? right now i just see one post, I need to see each post. – Chris Nov 7 '12 at 15:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.