Custom WordPress Website Design

What Do WordPress Theme Files Do?

Last updated October 2022

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

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.

Looking to Take Your Business to the Next Level?

See How Affordable a Custom WordPress Website Can Be →

Whether you are a small or large company, your website is the cornerstone of your business. We specialize in developing custom web designs for all businesses.

Don't waste time building your own site, get a professional-grade website without the headache.