A child theme is a small theme that inherits everything from another one, its parent, and contains only your changes. When the parent is updated, your changes stay where they are.
It is the difference between drawing on a wall and on a sheet of tracing paper placed over it.
Do you need one?
For years the answer was always yes. Today it depends on what you want to change.
| You want to | Child theme? |
|---|---|
| Change colors, fonts, spacing | No: theme settings or Styles |
| Add a little CSS | No: Additional CSS |
| Change the header, footer or a template in a block theme | No: the site editor saves it in the database |
| Edit PHP templates of a classic theme | Yes |
| Add functions in PHP | A snippets plugin, or yes |
| Keep your changes in Git and move them between sites | Yes |
| Deliver a design to a client | Yes |
If you only need a function, a plugin such as WPCode is safer, and it survives a change of theme.
What is in a child theme
Two files are enough:
wp-content/themes/
twentytwentyone/ (parent)
twentytwentyone-child/ (child)
style.css
functions.phpThe rest is optional. Any template you copy into the child, with the same name and path, replaces the parent's.
Create one by hand in five minutes
Step 1: the folder
Over SFTP or with the file manager of your hosting, create a folder inside wp-content/themes. The usual name is the parent's with -child at the end.
Step 2: style.css
/*
Theme Name: Twenty Twenty-One Child
Template: twentytwentyone
Version: 1.0.0
Text Domain: twentytwentyone-child
*/
/* Your styles below */Only Theme Name and Template are required. Template must be exactly the name of the parent's folder, with the same capital letters. It is the most common mistake.
Step 3: functions.php
<?php
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_style(
'child-style',
get_stylesheet_uri(),
array(),
wp_get_theme()->get( 'Version' )
);
}, 20 );Is the parent's style sheet missing? It depends on how the parent loads it. Open your site: if it looks bare, add this line inside the function, before the other:
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );Never use @import in style.css, as old tutorials do: it makes the page slower.
Step 4: activate it
Go to Appearance → Themes, activate the child and check the site. Menus and widgets sometimes have to be assigned again, since WordPress stores them per theme. Note down where they were before you activate it.
Optional: a screenshot.png of 1200 by 900 pixels, so you recognize it in the list.
Create one with a plugin
If you don't have SFTP, a plugin can do it. Check the dates first:
- Child Theme Wizard: updated in June 2026, simple, well rated.
- Generate Child Theme: updated in May 2026.
- Child Theme Configurator is the best known, with 300,000 installs, but its last update was in June 2025. It is close to abandoned, so we would use the others.
Once the child exists, you can delete the plugin.
How inheritance works
| File | What WordPress does |
|---|---|
style.css | Uses the child's. The parent's must be loaded as well |
functions.php | Loads both, the child's first |
Templates (single.php, header.php) | Uses the child's if it exists |
Parts called with get_template_part() | Same |
theme.json | Merges the two, and the child's wins |
templates/ and parts/ in block themes | The child's replaces the parent's |
As the child's functions.php is loaded first, you can't redefine a parent's function unless it was written with function_exists(). To remove something the parent adds, wait until it has loaded:
add_action( 'after_setup_theme', function () {
remove_action( 'wp_head', 'parent_function_name' );
}, 20 );Two functions that get confused
get_template_directory_uri()is always the parent.get_stylesheet_directory_uri()is the child if it is active.
For your own files, use the second one.
Common uses
Change one template. Copy single.php from the parent to the child and edit the copy. To know which to copy, see the template hierarchy.
A block theme. With style.css and a theme.json of a few lines you change the palette or the widths:
{
"version": 3,
"settings": {
"layout": { "contentSize": "720px", "wideSize": "1200px" }
}
}WooCommerce. Copy the template from woocommerce/templates to a woocommerce folder in the child. Review them after each big update: WooCommerce → Status lists the outdated ones.
Add code to the header. With the wp_head hook; here are more ways.
Looking after a child theme
- Copy as little as possible. Each copied template stops receiving the parent's fixes.
- Comment what you changed and why.
- Keep it in Git, or at least in your backups.
- After each update of the parent, compare your copies with the originals.
- Don't put in it what belongs to the site. Content types, shortcodes and integrations go in a plugin, so you don't lose them when you change theme.
- Never make a child of a child. WordPress doesn't support it.
Try changes on a staging copy. An error in functions.php can leave the site blank; if it happens, rename the child's folder over SFTP and WordPress will fall back.
Common errors
- "The parent theme is missing". The name in
Templateis wrong, or somebody deleted the parent. It must remain installed, though not active. - The styles don't change. Cache, or a stronger rule in the parent. Inspect the element with F12.
- The site looks different on activating it. The settings of the customizer are per theme. Export and import them, or set them again.
- A white screen. A missing semicolon, or a space before
<?php.
If you prefer to hand it over, our development team takes on WordPress work like this, and the web design team the design.
Frequently asked questions
Does it slow down the site?
Not noticeably. It adds one small style sheet.
Can I make one for a site that already has changes in the parent?
Yes. Download the original theme, compare it with yours and copy only the differences to the child. Then update the parent.
And with a page builder?
Elementor, Divi and others keep the design in the database. The child theme is still useful for functions and for the occasional template.
