Quick answer: A child theme is a small theme that inherits everything from a “parent” theme but lets you add your own code safely. To create one, make a new folder in /wp-content/themes/, add a style.css file with a Template: line naming the parent theme folder, add a functions.php file if needed, then activate the child theme in Appearance → Themes.
Without a child theme, any code you add to your theme’s files disappears the next time the theme updates. A child theme keeps your changes separate, so you get updates and keep your customisations.
Do you actually need a child theme?
| You want to… | Child theme needed? |
|---|---|
| Change colours, fonts or layout with the Customizer or Site Editor | No — these settings are saved in the database |
| Add a little CSS | No — use Appearance → Customize → Additional CSS or the Site Editor styles |
| Add PHP functions or hooks | Yes, or use a code snippets plugin |
| Change template files | Yes |
| Build a site for a client on a framework theme | Yes |
Step 1: Create the child theme folder
Connect to your site by FTP or your host’s File Manager and open /wp-content/themes/. Create a new folder. A common naming style is the parent name plus “-child”, for example kadence-child or twentytwentyfive-child. Use lowercase letters and hyphens, no spaces.
Step 2: Create style.css
Inside the new folder, create a file named style.css with this header:
/*
Theme Name: Kadence Child
Template: kadence
Description: Child theme for Kadence
Version: 1.0.0
Text Domain: kadence-child
*/
The most important line is Template. It must match the parent theme’s folder name exactly (not its display name). If it’s wrong, WordPress will say the parent theme is missing.
Step 3: Create functions.php and load styles
Many modern themes load the child stylesheet automatically, but for classic themes it’s safest to add a functions.php file that loads the parent and child styles:
<?php
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );
} );
Don’t copy the parent’s functions.php — the child’s file loads in addition to the parent’s, not instead of it. Check your theme’s documentation, because some parents already load their own styles a different way.
Step 4: Add a screenshot (optional)
Add a screenshot.png (1200 × 900 pixels) to the folder so the child theme has a preview image in the dashboard.
Step 5: Activate the child theme
- Go to Appearance → Themes.
- Find your child theme and click Activate.
- Check your site. Menus and Customizer settings may need to be set again, because they’re stored per theme.
New to installing themes? See how to install a WordPress theme.
Child themes for block themes
Block themes (like Twenty Twenty-Five) use theme.json and HTML templates instead of PHP template files. A child of a block theme works the same way — it still needs style.css with a Template line. You can then add:
- A theme.json file to override colours, fonts and spacing.
- Template files in a /templates/ folder to replace parent templates.
- Template parts in a /parts/ folder.
You can also use the free Create Block Theme plugin, which can generate a child theme from the Site Editor. The official child themes handbook page explains this in more detail.
Overriding a template file
To change a template in a classic theme, copy the file (for example single.php or footer.php) from the parent into the child folder, keeping the same name and path, then edit the copy. WordPress uses the child’s version first.
Common child theme problems
- “The parent theme is missing”: the Template line doesn’t match the parent folder name.
- Styles look broken: the parent stylesheet isn’t loading — check functions.php.
- White screen after editing functions.php: a PHP error. Remove your last change by FTP. See our white screen fix guide and turn on debug mode to see the error.
Child theme best practices
- Keep it small. Only add files you actually change. Fewer copied templates means fewer things to update when the parent changes.
- Use version control (such as Git) for client sites, so you can roll back.
- Test parent updates on staging first, especially if you have overridden templates.
- Comment your code so you (or the next developer) know why each change exists.
- Use hooks before templates. Many changes can be made with actions and filters in functions.php, which is safer than copying whole template files.
Following these habits keeps a child theme easy to maintain for years.
A real-world example
A freelance developer built a client site on a popular theme and added custom code directly to the theme’s functions.php file. Six months later, the client clicked “Update” on the theme, and every customisation disappeared — the custom post type, a tracking snippet and several layout tweaks. The developer rebuilt everything inside a child theme, and the client has updated the parent theme many times since without losing anything. Creating the child theme at the start would have taken ten minutes.
Child themes and security
A child theme keeps your code safe from theme updates, but it doesn’t replace keeping the parent theme updated — updates often include security fixes. Make sure any custom PHP you add sanitises input and escapes output. And remember that your theme’s security also depends on the server: the October 2026 PHP2Shell vulnerabilities affected unpatched PHP servers no matter how well a theme was written, so choose a host that applies patches quickly.
Should you use a child theme with a block theme?
With block themes, many design changes can be made in the Site Editor and saved in the database, so a child theme isn’t always needed. However, if you want to version-control your template changes, ship them to several sites, or add PHP functions, a child theme is still the cleanest approach. The Create Block Theme plugin can generate one from your Site Editor changes in a few clicks, exporting your customised templates and styles into a proper child theme folder.
Keeping your child theme tidy
Over time, child themes collect old code that nobody remembers. Once a year, review your child theme: remove functions you no longer use, delete copied template files that no longer differ from the parent, and add comments explaining why each remaining change exists. A tidy child theme is easier to update, easier to hand over to another developer and less likely to break when the parent theme changes.
Quick checklist before activating a child theme
Confirm the parent theme is installed and up to date, the Template line matches the parent folder name exactly, your style.css header is complete, and you have a fresh backup. Then activate the child theme, check your menus and Customizer settings, and view a few pages on desktop and mobile.
FAQ
Will a child theme slow down my site?
No noticeable difference. It adds one small stylesheet at most.
Can I make a child theme of a child theme?
No. WordPress supports one level: parent and child.
Is a code snippets plugin better than a child theme?
For a few PHP snippets, a snippets plugin is simpler. For template changes, use a child theme.
WordPressPrime.com is an independent guide and is not affiliated with the WordPress Foundation, WordPress.org or Automattic. Always back up your website before making changes, and check official sources for the latest details.
