Your WordPress theme is made up of numerous files that work together to create the layout and functionality of your website. Each file consists of a mixture of HTML, PHP and template tags that focus on a specific section of the site. Individually these files are useless but when you include them throughout your theme they merge together to form a complete and functioning website.
You can have any number of files in your theme and in this post we are focusing on the standard theme files that should be included in all WordPress themes.
Standard WordPress Theme Files
The template used when a page cannot be found.
The template used for all archived entries. It will be used when a category, author or date is queried.
The template used for displaying the comments in blog posts.
The template used for displaying the footer section at the bottom of your website.
One way to change the behavior of your website. You can add code here to extend functionality. Any code added here will only apply to that theme.
The template used for displaying the header section at the top of your website.
The main template in your theme. This file must be included in order for the theme to display correctly.
The template used for displaying content from the page section in the WordPress admin.
The template used to display the search results page.
The template used to display the sidebar section on your website.
The template used to display content from the posts section in the WordPress admin.
The main stylesheet. This must be included as it contains information about your theme.