Title: Including Archives.php problem
Last modified: August 19, 2016

---

# Including Archives.php problem

 *  Resolved [magicalwonders](https://wordpress.org/support/users/magicalwonders/)
 * (@magicalwonders)
 * [17 years ago](https://wordpress.org/support/topic/including-archivesphp-problem/)
 * Hi Folks,
 * I’m building my own theme and have looked at the Codex regarding including the
   archives.php template, but am a bit confused.
 * > Then from the Admin Panel, Write > Write Page
 * I assume this action has now been replaced by “go to Pages and Add New”?
 * The final instruction is
 * > In the sidebar open the Page templates box, and select the Archives template
 * Not sure what sidebar is being referenced? Hope someone can advise where I might
   find this “page templates box”
 * Many thanks,
 * Myles

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [17 years ago](https://wordpress.org/support/topic/including-archivesphp-problem/#post-1095748)
 * In the **Add New Page** screen there is a section in the right sidebar that reads:**
   Attributes**
 * You can set the _parent page_, the **template** (which apparently is what you
   are after) and the _page order_.
 * Assuming that you have created the template file correctly as described in the
   [Codex](http://codex.wordpress.org/Main_Page), then your archives template should
   be available in the drop-down menu there.
 *  Thread Starter [magicalwonders](https://wordpress.org/support/users/magicalwonders/)
 * (@magicalwonders)
 * [17 years ago](https://wordpress.org/support/topic/including-archivesphp-problem/#post-1095754)
 * O.K. I have created the following file called archives.php
 *     ```
       <?php get_header(); ?>
   
       <div id="mainContent" class="column">
   
       <?php get_search_form(); ?>
   
       <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>
   
       <?php get_footer(); ?>
       ```
   
 * This file has been uploaded to my themes directory. However, when I go to add
   new page and click on drop down list under attributes, the only items showing
   are the pages that have already been created. There are no template files to 
   select.
 * Am I missing a step here?
 *  Thread Starter [magicalwonders](https://wordpress.org/support/users/magicalwonders/)
 * (@magicalwonders)
 * [17 years ago](https://wordpress.org/support/topic/including-archivesphp-problem/#post-1095814)
 * I’ve just discovered I needed to add this code to the top of my template…
 *     ```
       <?php
       /*
       Template Name: Archives
       */
       ?>
       ```
   
 * Thanks to this blog for providing the solution – [http://jeff-way.com/2009/05/12/add-an-archives-page-to-your-wordpress-theme/](http://jeff-way.com/2009/05/12/add-an-archives-page-to-your-wordpress-theme/)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Including Archives.php problem’ is closed to new replies.

## Tags

 * [Archives.php](https://wordpress.org/support/topic-tag/archives-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [magicalwonders](https://wordpress.org/support/users/magicalwonders/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/including-archivesphp-problem/#post-1095814)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
