Template files are files that are the foundation for any blog. These are files which are referenced for the blog functionality. Every theme will have template files and we need to understand the template files better for us to be the best judge while choosing a theme for our blog.
A blog is built on various functionality, these can range from a simple layout of a blog to a more robust search option on the blog. What ever be the function to be performed, it is these template files that do the job.
These template files can be found on the right on a theme editor dashboard in your WordPress admin page.
The main template files are listed below with a brief on what they are, this is not an exhaustive list. Apart from the ones listed below, there can be additional files in a theme. These files can be anyother style sheets (CSS), images pertaining to the template and other files.
Style.css: This is a file which contains the style sheet (CSS – Cascading Style Sheet), in other words the sketch of your blog. This file defines the look and feel of your blog from the font to be used, the size and colour of the headings/titles, how the tables will appear, how the links will be, etc.
index.php: This is the main template file for your blog. This file defines the functionality of the blog, what comes first and what next.
home.php: This is the homepage template which defines the files that will be one the blog’s homepage.
Single.php: This is the template for single posts, defining how the post will appear on a single page.
Page.php: You can have as many pages on your blog like, about page sitemap page, archives page, etc,. This is the template for pages defining how the pages will appear on the blog.
category.php: Categories are sub divisions of subjects on a blog. This is the template for category indexes.
author.php: This is the template used to seggregate all posts by a certain author
comments.php: This is the template file which defines how the comments will be handled on the blog.
date.php: This template is used to look date specific seggregation on posts on a blog.
archive.php: This template will be used alongwith the category.php, author.php or date.php. This lists all the posts either date wise, month wise or year wise as defined by the blog owner.
search.php: This is the file that is used for searches on the blog, This is an important file to look in your themes.
404.php: 404 is an error that occurs when there is a broken link or someone searches for some posts that have been removed for some reason. This too is a very important template file to have.
Please list down the other template files, that I may have missed on this post in the comments below.