Home » WordPress

How To Create An Archives Page

Posted By: BioTecK on Tuesday 6 May 2008 with 2 Comments

Having an archives page for your WordPress blog is something very important. In an archive page you can archive links listing by categories, months, year and pages.
Most free WordPress themes already have an extra page template for an archive page. Just look in your theme’s folder for an php file called archives.php. This is different then your default archive template which is called archive.php (without the “s”).

But if you have a theme which doesn’t have an archive page, you can make one your own very easy when you follow this steps. I take my own archive page as an example.

  1. Make a copy of your index.php and call it archives.php. This is just to preserve your theme structure!
  2. Open the file and type this at the top of the Archives.php
  3. Now remove the original loop code in the index.php.
  4. Add the category listing by inserting this code:<h2>Archives by Categorie:</h2>
    <ul><?php list_cats(0, '', 'name', 'ASC', '/', true, 0, 1); ?></ul>
  5. Add the month listing by inserting this code:<h2>Archives by Month:</h2>
    <ul><?php wp_get_archives('type=monthly'); ?></ul>
  6. Add the page listing by inserting this code:<h2>Archives by Pages:</h2>
    <ul><?php wp_list_pages('title_li'); ?></ul>
  7. Save the archives.php file, upload it to your theme’s folder (wp-content/themes/themename/).
  8. To use your archives page you have to create a new page and select your newly upload Archives page template for that page!


2 Comments so far, be the next one! »

  • Pixel Shoppe said:

    Hi, thanks for dropping by and commenting. It is always appreciated. Cool post, I had a hard time figuring out how to make an archive. :oops:

    Pixel Shoppes last blog post..Vacation Rentals

  • BioTecK (Author) said:

    Hello Pizel Shoppe,
    Glad that I could help you!! Making an archives page is very easy as you can see! :D

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Comment Guidelines
Stay on topic, Do not include affiliate links, be nice and keep it clean. Please note that all comments will be moderated (due to too much spam)!

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
All line breaks and paragraphs will be generated automatically.

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.

CommentLuv Enabled