The following is a list of commonly used template files in custom WordPress themes. Each template file functions based on WordPress’s Template Hierarchy.
๐น Basic Templates List
File Name |
Purpose/Description |
style.css |
Theme information and style definitions (required) |
index.php |
Fallback basic template (required) |
functions.php |
File for adding theme functionalities |
screenshot.png |
Theme thumbnail image (for admin screen) |
๐น Homepage, Post, and Page Related
File Name |
Purpose/Description |
front-page.php |
Site’s front page (if set to a “Static Page” in settings) |
home.php |
List of posts (if set to “Your latest posts” in settings) |
single.php |
Individual page for a regular post (post type: post) |
page.php |
Individual page for a static page |
singular.php |
Fallback for all single pages like single.php and page.php |
๐น Category, Archive, Search, etc.
File Name |
Purpose/Description |
category.php |
Category archive |
tag.php |
Tag archive |
taxonomy.php |
Custom taxonomy archive |
archive.php |
General archive for dates, custom post types, etc. |
search.php |
Search results page |
404.php |
Display when a page is not found |
๐น Partial Templates (loaded with get_template_part()
)
File Name |
Purpose/Description |
header.php |
Content within <head> and the site’s header section |
footer.php |
Site’s footer section |
sidebar.php |
Sidebar section (get_sidebar() ) |
content.php |
Common template for post content (used within the loop) |
comments.php |
Comments display section |
๐น Custom Post Type Support (as needed)
File Name |
Purpose/Description |
single-โโโ.php |
Individual page for custom post type “โโโ” |
archive-โโโ.php |
Archive for custom post type “โโโ” |
While a theme can function with just style.css
, index.php
, and functions.php
, it’s common practice to include files like header.php
, single.php
, and archive.php
to enhance the user experience.