Custom theme, part 2: Two ways of building WordPress themes
There are basically two big approaches to building WordPress themes:
-
๐ง Classic (PHP template-based themes)
-
๐ Modern (Block / Full Site Editing themes with HTML templates)
Letโs break them down properly.
1๏ธโฃ Classic WordPress Theme (PHP Template System)
This is the โold-schoolโ but still very widely used method.
Structure
A classic theme consists of PHP files like:
๐ง How it works
-
WordPress uses Template Hierarchy
-
It loads different PHP files depending on the request:
-
single.phpโ blog post -
page.phpโ page -
archive.phpโ category/archive
-
-
You split layout into parts:
Each part is a PHP file.
๐ก What you build with
-
PHP (core logic)
-
HTML
-
CSS
-
JS
-
WordPress hooks (
add_action,add_filter) -
Template tags (
the_title(),the_content())
โ Pros
-
Full control
-
Mature ecosystem
-
Tons of tutorials
-
Perfect if you like backend logic (you probably would ๐)
โ Cons
-
Mixing PHP + HTML can get messy
-
Harder for non-devs to edit layouts
-
Less visual editing
2๏ธโฃ Modern WordPress Theme (Block / FSE Theme)
This is the new approach introduced with Full Site Editing in WordPress 5.9+.
Instead of PHP templates, you build themes with:
-
HTML template files
-
Block JSON config
-
Reusable block components
Structure
Typical structure:
Notice something?
๐ Templates are .html, not .php.
๐ฅ How it works
Instead of PHP functions like:
You use block markup:
Everything is a block.
Header, footer, query loops โ all blocks.
WordPress parses this block HTML and renders it dynamically.
๐ง Core idea
Layout = Blocks
Design system = theme.json
Templates = HTML with block markup
You donโt write PHP for layout anymore.
๐ก What you build with
-
HTML
-
Block comments (
<!-- wp:... -->) -
theme.json (design system)
-
Optional custom blocks (React if advanced)
โ Pros
-
Cleaner separation of structure & logic
-
Visual editing in admin
-
Reusable block patterns
-
Future direction of WordPress
โ Cons
-
Less raw control than classic PHP
-
More abstract
-
Can feel โmagicalโ
-
Still evolving ecosystem
๐ Side-by-Side Comparison
| Classic Theme | Block Theme |
|---|---|
| PHP templates | HTML block templates |
| get_header() | template parts via blocks |
| functions.php heavy | theme.json heavy |
| Dev-focused | Editor-focused |
| Backend logic flexible | Frontend editing flexible |
๐ง Which One Should You Care About?
Since youโre a developer who likes structure and control:
-
If you want deep backend logic and customization โ Classic PHP themes
-
If you want modern architecture & product-oriented flexibility โ Block themes