Tips on Webhosting, Blogging, Web Design, Webmastering, SEO, CSS, and whatever the damn hell I know.
This covers how to create a basic archives page, using a template. It’s fairly similar to the previous post, apart from the coding.
In the WP admin panel, go to Presentation » Theme Editor. Open archives.php.
Open archives.php manually on Notepad or something similar, if your files are not writable.
Add this to the top of the archives.php file.
This enables the php file to be called out as a template.
<?php/* Template Name: Archives Page */ ?>
Add the following code below.
You might already have this in your theme’s archives.php file. It displays your archives according to month and subject.
<h2>Archives by Month:</h2><ul> <?php wp_get_archives(’type=monthly’); ?> </ul> <h2>Archives by Subject:</h2> <ul> <?php wp_list_categories(); ?> </ul>
This is an example of a full archives.php file.
<?php /* Template Name: Archives Page */ ?><?php get_header(); ?><!– Container –><div class=”CONBG”><div class="CON"><!-- Start SC --><div class="SC"> <?php include (TEMPLATEPATH . '/searchform.php'); ?> <h2>Archives by Month:</h2> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> <h2>Archives by Subject:</h2> <ul> <?php wp_list_categories(); ?> </ul> </div> <!-- End SC --> <?php get_sidebar(); ?> <!-- Container --> </div></div> <?php get_footer(); ?>
The codes above and below the archives section, follow the main index template, so that the rest of the page’s design is called out.
In WP admin, go to Write » Write Page.
Create a new page titled “archives”. Leave the page content blank.
When you’re on Write Page, look to the right.
Apply the Archives Page Template (which is archives.php).

Now you should have a working Archives page.
Leave a reply
Some HTML is allowed: ‹b›, ‹i›, ‹a›.