arrow_back
Back

WordPress theme structure: required files, style.css header, screenshot

Andrew Dorokhov Andrew Dorokhov schedule 2 min read
menu_book Table of Contents

Required files

A theme needs only two files to be recognised by WordPress:

index.php
style.css

And one optional file that almost every theme ends up having:

functions.php

Everything else (header.php, footer.php, single.php, page.php and so on) is added as the theme grows.

Style sheet header

WordPress reads the theme metadata from a comment at the very top of style.css. Without this comment the directory is not treated as a theme.

/*
Theme Name: Sapro Solutions Ltd
Author: Colouring Department
Author URI: https://colouringdepartment.com/
Version: 1.0
*/

Theme Name is the only required field — the rest is what the user sees on the Appearance → Themes screen.

Screenshot

The preview image shown in the admin area must be named screenshot.png and placed in the top level directory of the theme.

It should accurately show the theme design and be saved in PNG format. The recommended image size is 1200×900 pixels.

Favicon

There is no need to hardcode a favicon into the template. WordPress has a built-in Site Icon feature:

Appearance -> Customize -> Site Identity

The uploaded icon is stored in the media library and WordPress prints the required <link> tags itself, as long as the theme calls wp_head().

Where to get ready-made themes

open_in_new ThemeForest is the largest marketplace for commercial WordPress themes and is a good place to look for a starting point when you don’t build the design from scratch.

code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward