Archive links don’t work when clicked

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.

Read More

The url does change to:

http://localhost:8888/2012/11/?cat=6

But nothing changes on the page.

Related posts

Leave a Reply

1 comment

  1. 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.