SponsoredHosinger Special Offer

WP WordPress Theme Development

Build classic and block WordPress themes from scratch: the template hierarchy, The Loop, the_title() and the_content(), template parts, menus, the Customizer, child themes and theme.json.

What a WordPress Theme Is

WordPress Theme Development Lesson 1 of 30 ~3 min read

Overview

A WordPress theme is the set of template files, styles and scripts that decides how your content looks — while WordPress itself stores the content and a plugin adds features.

That split is the single most important idea in this whole path. Posts, pages, users and settings live in the database and belong to WordPress. A theme only presents them. If someone switches to a different theme tomorrow, their content must still be there, intact. Anything that would vanish with the theme — a custom post type, a shortcode, a contact form — belongs in a plugin, not in your theme.

What a theme is responsible for

A theme controlsA theme should not control
Page layout, typography, colours and spacingCustom post types and taxonomies
Which template renders which URLShortcodes your content depends on
Navigation menu locations and widget areasSEO data, analytics, contact forms
Featured image sizes used by the designAnything a user would lose by switching theme

The WordPress.org theme review team enforces this rule — it is called plugin territory — and following it from day one keeps your themes portable and your clients safe.

How WordPress loads a theme on every request

  1. The visitor requests a URL such as /2026/10/hello-world/.
  2. WordPress boots: wp-config.php connects to the database and loads core.
  3. Active plugins load, then the active theme's functions.php runs.
  4. WordPress parses the URL into a query — "a single post with this slug".
  5. It runs that query against the database and stores the result as the main query.
  6. The template loader walks the template hierarchy to choose one file, such as single.php.
  7. That template runs The Loop and prints the HTML the visitor sees.

You will meet every one of those steps in this path. Steps 6 and 7 — choosing a template and printing content with tags like the_title() and the_content() — are the heart of theme development.

Classic themes and block themes

WordPress currently supports two kinds of theme, and this path teaches both.

Classic themeBlock theme
Templates are written inPHP files such as single.phpHTML files of block markup such as templates/single.html
Design settings live infunctions.php and CSStheme.json
Edited visually in the Site EditorNoYes
Best forLearning how WordPress works, custom PHP logic, existing sitesNew sites that clients edit themselves

We start with classic PHP themes because they show you exactly what WordPress is doing. Once you understand the_title(), the block equivalent <!-- wp:post-title /--> makes immediate sense. Lessons 28 and 29 cover block themes properly.

What you will build

Across this path you will build GDC Starter, a complete classic theme with a blog, single posts, pages, custom page templates, menus, widget areas, a customizer setting, translation support and a child theme. Every lesson adds to the same files, so by the end you have a theme you understand line by line.

Tip: Keep the WordPress Theme Handbook open in a tab. When this path says a function exists, the handbook is where you check its full parameter list.

Practice

  • Open any WordPress site you have and switch between two themes. Notice that every post survives the switch — that is the content/presentation split in action.
  • List three features a client has asked you for in the past. Sort them into "theme" and "plugin territory".
Create a free account to save which lessons you've finished. Save my progress