When writing a tutorial about creating an archives page last week I was reminded about the confusion which arises between the Archive.php and Archives.php files.
Sometimes WordPress themes have both files in the theme directory though it is quite common for a theme only to have the Archive.php. So what is the difference between these two files?
What is Archive.php
The Archive.php template is used to display monthly archives, categories, author pages and more. For example, the url www.mysite.com/2010/02/ would display all posts in February 2010 and would be generated by the Archive.php template. Confusingly, the file is called Archives by WordPress, which is where a lot of the confusion arises.
It’s worth noting that in the WordPress Template Hierarchy Archive.php comes before index.php in category, author and date displays. That is, if an Archive.php file does not exist, WordPress will use index.php instead.
What is Archives.php
The Archives.php file is a page template. If you change the template of one of your pages to use the Archives page template you can call certain functions like wp_get_archives(); (which lets you display older posts via day, week, month and year) and wp_list_categories() (which displays posts by categories). It’s worth noting that the Archives.php can be called anything, though it tends to be named Archives.php in themes.
What is the difference between Archive.php vs Archives.php
So if you come across both of these files in your theme and are confused about which does which just remember that Archive.php is the file which controls how older posts are shown when someone clicks on a category link or the older posts link at the bottom of the page. Whereas Archives.php is a page template which lets you call functions which allow you to display older posts 🙂