A WordPress theme is, at its simplest, just a folder of files inside wp-content/themes/. What makes WordPress recognize that folder as a theme — and let you activate it from Appearance → Themes — comes down to two specific files.
style.css is the one file every theme must have, and not for its CSS — WordPress reads a comment block at the very top of it to get the theme's name, author, and version:
/*
Theme Name: My Custom Theme
Theme URI: https://example.com/
Author: Your Name
Description: A custom theme built from scratch.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: my-custom-theme
*/The second required piece is a template file capable of rendering something — in practice this is always index.php, since it also doubles as WordPress's catch-all fallback (more on that in the template hierarchy lesson). A folder with just these two files is technically a valid, activatable theme, even though it would look identical on every single page.
In practice, a working custom theme has quite a few more files, each with a specific job:
| File | Purpose |
|---|---|
| style.css | Theme metadata (above) — often the main stylesheet too, though enqueuing separate files is common (see the enqueuing lesson) |
| functions.php | Theme setup and custom logic — effectively a plugin that's scoped to this theme |
| header.php | The opening HTML shared by every page — <head>, site header, navigation |
| footer.php | The closing HTML shared by every page — footer content, closing tags |
| index.php | The universal fallback template — WordPress falls back to this when nothing more specific matches |
| page.php | Template for standalone pages |
| single.php | Template for individual blog posts |
| 404.php | Shown when no content matches the requested URL |
| screenshot.png | Theme preview shown in Appearance → Themes — not required, but every real theme has one |
Create a new folder inside wp-content/themes/, named after your theme (lowercase, hyphenated — this becomes the theme's slug, referenced throughout PHP code and used for text translations). Add style.css with the header comment above and a bare index.php, and the theme already shows up — and can be activated — in Appearance → Themes.
Screenshot dimensions
screenshot.png should be 1200×900 pixels (a 4:3 ratio) — WordPress crops anything else, sometimes awkwardly. It's cosmetic only, but worth getting right once rather than fixing later.
Every remaining lesson in this section fills in one of these files properly, starting with functions.php — the file that sets up everything else.