Adding archives.php to WP site

archieves.php, wordpress code, customized page template

Actually, I should say how to create a customized page using a template page php file.

I had created a WP site with both pages and posts. But instead of installing WP at the root and at the blog subdirectory, I just installed it at the root and listed the latest blog posts titles in the sidebars.

But I still needed a way for people to get the a place where they can enter the “blog,” so I created a customized archives.php and list post by category links and monthly links.

From the WordPress Forum, I knew I needed to create a new page with a sensible title and blank content, then select a template. But for the life of me, the archives.php just wouldn’t show up in the template pulldown.

Then I figured out, all I had to do is add these lines to the beginning of the archives.php. (don’t forget to put the php tags on the outside!)

/*
Template Name: Archives
*/

Now go back to your page list, use the Quick Edit for your new page, and you will find Archives in the template pull down. Amazingly simple yet extremely illusive at first.

* At this time, I am working with the WP version 2.8.4. *

Leave a Reply