In another effort to de-clutter the sidebar and begin your initiation for The Organization for the Organized, here’s how to create an archives page for archive links listing by categories and months. First of all, check out the WPDesigner’s archives page to see what you’ll be adding to your blog.
Second, most free WordPress themes already have an extra page template for an archives page. Look in your theme’s folder for an unused PHP template file. Usually, theme authors name this template archives.php, which is different from your default archive template, archive.php (without the “s”).
Third, you need to know that this tutorial is not the end-all tutorial for creating a custom archives links listing page. The structure of each theme is not always exactly the same as the next theme’s structure. All I can show you is the basics and how I did it.
The Steps:
1. Create a new file and name it archives.php
2. At the top of that file, type:
<?php /* Template Name: Archives Page */ ?>
Without those lines above, you won’t be able to use your new archives template file so be sure that you don’t leave that out.
3. Add the loop, title, category listing, and month listing:
<?php while(have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> <ul><?php wp_list_cats(’sort_column=name&optioncount=1′) ?></ul> <ul><?php wp_get_archives(’type=monthly&show_post_count=1′) ?></ul> <?php endwhile; ?>
4. Tweak the codes above to make it fit in with your current theme. Here’s where different theme structures come into play. I can’t give you my archives template because it might not work with your theme’s structure.
5. Upload it to your theme’s folder.
6. Create a new page and select your newly upload Archives page template for that page.