Why Not Just Edit the Theme?
It's tempting to open a theme's files directly and start editing — change a template, tweak a function, add some CSS. The problem is updates. The moment the theme author releases a new version and you update, every one of those direct edits is wiped out and replaced with the fresh, unmodified files.
A child theme solves this by acting as a separate, tiny theme that inherits everything from a "parent" theme, but keeps your customizations in its own folder — untouched by parent theme updates.
- ✓A child theme inherits all styles and templates from its parent by default.
- ✓Files you add to the child theme override the matching parent file.
- ✓Updating the parent theme never touches anything inside the child theme.
What a Child Theme Needs
At its simplest, a child theme is just a folder with two files inside wp-content/themes/.
Contains a comment header that tells WordPress the theme's name and which parent it belongs to.
Loads the parent theme's stylesheet, plus any custom PHP functions you want to add.
The parent theme is the foundation; the child theme is a small, separate layer of changes sitting safely on top of it.
The style.css Header
/* Theme Name: My Child Theme Template: twentytwentyfour */
"Template" must exactly match the parent theme's folder name — this line is what links the two themes together.
Building functions.php
wp-content/themes/, named something like my-child-theme.What Happens at Update Time
Common Child Theme Mistakes
Breaking Down What You Just Learned
Child themes protect customizationsUpdates to the parent theme never overwrite anything in the child theme's folder.
Only two files are requiredA minimal child theme needs just style.css and functions.php.
The Template header links the two themesIt must exactly match the parent theme's folder name.
functions.php loads parent stylesWithout enqueuing the parent stylesheet, the site loses its styling.
Block themes differ slightlyFull Site Editing themes lean more on template parts and theme.json than classic child theme patterns.
Try It Yourself
Create a child theme for your current theme, activate it, and add one custom CSS rule to its style.css — like changing the site's link color — to confirm the override works.
Move Your Capstone Site to a Child Theme
Making your customizations update-safe
By the end of today, your capstone site should be running on a working child theme instead of the parent theme directly.
- Create a new child theme folder with style.css and functions.php.
- Set the Template header to match your current active theme.
- Enqueue the parent stylesheet in functions.php.
- Activate the child theme and confirm the site still looks correct.
- Add one small CSS change to prove the child theme is taking effect.
Recap
A small theme that inherits from a parent while keeping customizations update-safe.
The full theme a child theme borrows its templates and styles from.
The style.css line that links a child theme to its parent by folder name.
Loading the parent stylesheet from functions.php so styling isn't lost.
Key Takeaways
- Editing a parent theme directly means losing all changes the next time it's updated.
- A child theme only needs a style.css file and a functions.php file to work.
- The Template header in style.css must exactly match the parent theme's folder name.
- functions.php should enqueue the parent theme's stylesheet so styling carries over.
- Child themes keep customizations safe while still allowing the parent theme to update freely.