To create a custom WordPress theme, decide between a block theme (built with HTML templates and theme.json, edited in the Site Editor) and a classic theme (PHP templates). A minimal block theme needs only style.css, theme.json and templates/index.html. Build on a local site, follow the template hierarchy, enqueue assets properly and keep features in plugins, not the theme.
- Block themes are the modern default and need very little PHP.
- theme.json controls colours, fonts, spacing and layout in one file.
- The template hierarchy decides which file WordPress uses for each page.
- A child theme is the right choice if you only want to change an existing theme.
- Design belongs in the theme. Features belong in plugins.
Do you really need a custom theme?
Imagine a law firm that buys a feature-heavy multipurpose theme, then fights it for months: slow pages, a dozen bundled plugins, layouts that never quite match the brand. A lean custom theme built around their real pages would load faster and be easier to edit.
You need a custom theme when you want full control of design and performance, a unique brand, or a product to sell. If you just want to tweak colours on an existing theme, a child theme or a page builder is faster.
Block theme or classic theme: which should you build?
| Block theme | Classic theme | |
|---|---|---|
| Templates | HTML files with block markup | PHP files (header.php, single.php) |
| Styling | theme.json plus CSS | style.css and Customizer |
| Editing | Site Editor, visual | Code and widgets |
| Best for | New sites, clients who edit layouts | Legacy sites, heavy custom PHP, some page builders |
What files does a minimal block theme need?
my-theme/
style.css (theme header: name, version, author)
theme.json (colours, fonts, spacing, layout)
templates/
index.html (fallback template)
single.html
page.html
parts/
header.html
footer.html
functions.php (optional: enqueue extra assets)
The style.css header tells WordPress the theme exists:
/*
Theme Name: My Theme
Author: Your Name
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: my-theme
*/
How do you build the theme step by step?
- Set up a local site with a tool such as Local or WordPress Studio.
- Design first. Sketch the homepage, a post, a page and an archive in Figma or on paper.
- Create style.css and theme.json. Define your palette, font sizes and spacing scale in theme.json so the editor offers only on-brand choices.
- Build templates and parts in the Site Editor, then export them into your theme files.
- Add patterns for sections you reuse, such as hero, pricing and testimonials.
- Enqueue extra CSS or JS with wp_enqueue_scripts, only if you need them.
- Test on mobile, with accessibility checks and in PageSpeed Insights.
- Zip and install on staging, then live.
Custom post types, plugins, theme tweaks and integrations written the WordPress way, update-safe and documented.
What is the template hierarchy?
WordPress chooses a template by going from the most specific to the most general file. For a single blog post it tries single-post-{slug}, then single-post, then single, then singular, then index. Understanding this lets you design one special page without touching the rest.
What makes a theme good for SEO and speed?
- One H1 per page and a logical heading order.
- Minimal CSS and JavaScript, system or self-hosted fonts.
- Responsive images with width and height set to avoid layout shifts.
- Accessible colour contrast, focus styles and skip links.
- Clean HTML that works with Yoast or Rank Math schema.
Not ready to code a theme? See how to customise a WordPress theme without coding or the best WordPress themes for 2026.
Frequently asked questions
Is it hard to create a WordPress theme?
A simple block theme is quite approachable if you know basic HTML and CSS. Complex classic themes with custom PHP take more experience.
Should I build a block theme or a classic theme in 2026?
For most new sites, a block theme. It is the direction WordPress is moving and lets clients edit layouts visually.
What is theme.json?
A configuration file that sets colours, typography, spacing and layout options for the editor and front end in one place.
Child theme or custom theme?
Use a child theme to adjust an existing theme. Build a custom theme when you need a unique design or maximum performance.
Can I use Elementor with a custom theme?
Yes. Many developers build a light custom or starter theme and design pages with Elementor on top.
Sources
Custom post types, plugins, theme tweaks and integrations written the WordPress way, update-safe and documented.
More WordPress guides
Guide, 4 min readHow to Create Custom Post Types in WordPress (2026 Guide)
Guide, 4 min readHow to Create a WordPress Plugin from Scratch (2026 Beginner Guide)
Guide, 4 min readWordPress Hooks and Filters Explained with Examples (2026 Guide)
Guide, 4 min readHire a WordPress Developer or Learn It Yourself? Cost and Time GuideRather have an expert run your WordPress site?
Tanvir H is a Bangladesh-based WordPress and Elementor web designer with 7+ years of experience, 650+ projects and a 4.9 client rating. New websites, redesigns, fixes, speed, security and SEO, handled by one expert who explains everything in plain English and works with clients worldwide.



