views:

252

answers:

1

Hello,

We am setting up a WP-MU at work and one of my tasks is to make a link in the sidebar that will will go to a page displaying a monthly archive.

The sidebar must not contain the archive list just a link to a page (generated on the fly by WP) that shows the archive by month.

This is probably simple, but I have spent hours going through Codex and blog posts and not making headway.

Can anyone help me?

Thank you, Frank Luke

+1  A: 

WordPress Codex: Creating an Archive should explain how to generate the monthly archive page itself. The template tag to get the monthly archives is:

<?php wp_get_archives('type=monthly'); ?>

If you then have your archives template setup according to Creating an Archive you should only need to add a link as so in the sidebar template (i.e. sidebar.php):

<a href="/archives.php">Monthly Archives</a>

with the appropriate URI for your setup.

Michael Greene
Thanks. That's got me close to what we want. I had actually tried the above first. Boss said what we want is for the link to wind up calling archive.php and it to then display a page with links to December 2009, November 2009, October 2009, etc. If that can be done.
Frank Luke