WordPress powers a huge share of the websites on the internet, but there are two very different ways to build with it. One is dragging blocks or page-builder widgets onto a page and never opening a code editor. The other — what this section teaches — is writing the actual PHP template files yourself, so you control exactly what a theme does, down to the last detail.
A WordPress theme is the set of files that decides how a site looks and how its content is arranged on the page. An off-the-shelf theme from the WordPress theme directory is built to work for thousands of different sites at once, which means it's full of settings, options, and compromises it has to make to stay generic.
A custom theme is built for one site. Every template file exists because that specific site needs it, and nothing else is in the way. That's the trade you're making by learning to build one by hand: more work up front, in exchange for a site that does exactly what it needs to and nothing more.
Since WordPress 5.0, the default way to write a page has been the block editor (also called Gutenberg) — a drag-and-drop interface for arranging content in blocks, built directly into the pages and posts screens. It's genuinely useful for a lot of sites, especially ones a non-technical owner needs to edit themselves without any help.
It's a poor fit for custom theme work, though. A block-based page stores its layout as HTML markup mixed into the post content itself, which fights against a theme built to control layout through its own PHP templates instead. This section builds themes the other way: content stays simple (plain text and structured custom fields), and the theme's PHP files — not the editor — decide how everything is laid out and displayed.
What about Elementor or Divi?
Page builder plugins like Elementor and Divi solve a similar problem a different way — visual, drag-and-drop page building, but as a plugin layered on top of any theme. They're useful tools and worth knowing about, but they're a separate skill from what this section teaches. Here, the theme's own PHP code is what controls the page.
Three plugins do almost all of the heavy lifting for the kind of custom theme this section builds:
| Plugin | What it does | Why it's used here |
|---|---|---|
| Classic Editor | Replaces the block editor with the older, plain content editor | Keeps post content simple — plain text, not layout markup — so the theme's templates stay in charge of layout |
| CPT UI | Registers custom post types and custom taxonomies through an admin screen, no PHP required | Lets a theme model real content types — "Projects," "Team Members," "Testimonials" — instead of stretching regular posts to fit |
| Secure Custom Fields (SCF) | Adds structured custom fields (text, images, repeaters, and more) to any content type | Gives editors real structured fields to fill in, and gives templates a reliable, typed way to read that data back out |
None of these are strictly required — WordPress can register post types and custom fields with plain PHP code alone — but all three are genuinely the practical, real-world way this kind of theme gets built, and they're what the rest of this section uses throughout.
This section assumes you're already comfortable with HTML, CSS, and PHP's own syntax — variables, conditionals, loops, and functions. If PHP itself still feels shaky, it's worth spending time in the PHP section first; everything from here on assumes that part is second nature, and focuses purely on how WordPress uses PHP to build a site.
The next lesson gets an actual WordPress install running locally, so every example from here on is something you can build and click through yourself.