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 am looking to create a page in Wordpress to output links to all of our posts from every month since we launched the blog. I have seen the archive.php template file in Wordpress, but this seems to overwrite a lot of other pages too (search results, author results, etc.)

So my plan is to create a single page similar to this archives page example. I was going to write a separate function solely for this page in my functions.php file, then use a shortcode to call out the info. Is this the best approach, or could I be going about this another way? Would appreciate any help on the topic :)

share|improve this question
up vote 1 down vote accepted

I would suggest taking a look at the Template Hierarchy structure to fully understand WHY archive.php overwrites certain pages (although it shouldn't overwrite search results)

If you wanted to go a custom template direction (might be the best way) I would do something like this

create a monthly-arcive.php file and paste the following (you can name it whatever)

 * Template Name: Monthly Archive
  //get the header

//normal WordPress loop 
if ( have_posts() ) : while ( have_posts() ) : the_post(); 
endif; ?>

//show the archive list
<?php wp_get_archives('type=monthly'); ?>

//get footer
<?php get_footer(); ?>

Then create a new page and select "Monthly Archive as its template and you should be all set.

Things to note: You will need to style the custom template to match your other pages you may even want to start out by making a copy of another page. You should also look at wp_get_archive() in the Codex for more examples.

Hopefully that helps.

share|improve this answer
yeah this was great I really appreciate your response! I think this is the best way to go about things. I'll pop back if I have problems but your example is practically dumb-proof – Jake Rocheleau Sep 25 '11 at 21:41

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.