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.
Lessons
Build themes on a local copy of WordPress running on your own computer, with debugging switched on, so mistakes show up as clear error messages instead of a blank white page on a live site.
| Tool | Good for | Notes |
|---|---|---|
| LocalWP | Beginners and freelancers | One-click WordPress sites, built-in SSL and email catcher. |
| XAMPP / MAMP | If you already use them for PHP | Install WordPress manually into htdocs. |
| wp-env | Developers comfortable with Docker | npx @wordpress/env start — what core contributors use. |
| WordPress Studio | Fast local sites on macOS and Windows | Free, by Automattic. |
Any of them is fine. What matters is that you have a running site, access to its files, and the ability to edit wp-config.php.
Open wp-config.php in the site root and find the line define( 'WP_DEBUG', false );. Replace it with the block below. Put it above the line that says "That's all, stop editing!".
// Show every PHP warning and notice while developing.
define( 'WP_DEBUG', true );
// Write them to wp-content/debug.log as well...
define( 'WP_DEBUG_LOG', true );
// ...but don't print them into the page HTML, where they break layouts.
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
// Load unminified core CSS and JS so browser errors point at readable code.
define( 'SCRIPT_DEBUG', true );Now every notice your theme triggers lands in wp-content/debug.log. Keep that file open while you work — a good theme produces zero notices.
Watch out: Never leave WP_DEBUG on a production site. Notices can leak file paths and database details to visitors.Themes live in wp-content/themes/. Each theme is one folder. Create the folder for the theme you will build throughout this path:
cd wp-content/themes
mkdir gdc-starter
cd gdc-starterThe folder name becomes the theme's slug. Use lowercase letters, numbers and hyphens only. It is also the name WordPress stores in the database to remember which theme is active, so do not rename it once a site is using it.
An empty site hides bugs. Your theme has to cope with very long titles, posts with no featured image, nested comments, sticky posts and images of every shape. Import the official Theme Unit Test data:
Tip: Also install the Query Monitor plugin. It shows which template file rendered the current page, every database query, and every hook — you will use it constantly from lesson 5 onwards.
wp-content/debug.log appears after you visit a page with a deliberate typo in a plugin.gdc-starter folder. In the next lesson you will make WordPress recognise it.In accordance with Section 6 & Section 7 of the DPDP Act 2023, third-party analytics and marketing trackers are strictly gated behind your affirmative consent. You may withdraw consent at any time under Section 6(4).
Essential for session authentication (ci_session), Cross-Site Request Forgery security (csrf_cookie_name), and Cloudflare DDoS/bot prevention. Cannot be disabled.
Gated under DPDP Section 7. Allows Google Analytics 4 (Google Consent Mode v2) to measure aggregate, anonymized tool usage.
Enables browser local storage to preserve your theme selection (dark/light mode) and code editor layout between visits.
Used to display developer sponsorships and native tool partner notices.