What Do WordPress Theme Files Do?

Your WordPress theme is made up of numerous files that work together to create the layout and functionality of your website. Each file consist of a mixture HTML, PHP and template tags that focus on a specific section of the site. Individual 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

404.php
The template used when a page cannot be found.

Archive.php
The template used for all archived entries. It will be used when a category, author or date is queried.

Comments.php
The template used for displaying the comments in blog posts.

Footer.php
The template used for displaying the footer section at the bottom of your website.

Functions.php
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.

Header.php
The template used for displaying the header section at the top of your website.

Index.php
The main template in your theme. This file must be included in order for the theme to display correctly.

Page.php
The template used for displaying content from the page section in the WordPress admin.

Search.php
The template used to display the search results page.

Sidebar.php
The template used to display the sidebar section on your website.

Single.php
The template used to display content from the posts section in the WordPress admin.

Style.css
The main stylesheet. This must be included as it contains information about your theme.

WordPress Theme Issues?

Feel free to contact us if you have any questions, concerns or issues.

Let's Stay Connected

We'll send you an occassional email when we post new resources. We'll never sell your email address and you can unsubscribe at any time.
Try it out — it's free.