How to Create a WordPress Child Theme (Step by Step)
A WordPress child theme is a theme that inherits the functionality and styling of another theme (the “parent theme”) while allowing you to make modifications that survive parent theme updates. Creating one requires just two files — a style.css with a specific header and a functions.php that enqueues the parent theme’s styles. The entire process takes less than 10 minutes.
If you have ever customised your WordPress theme — added custom CSS, modified a template file, changed a function in functions.php — and then lost all those changes when the theme updated, a child theme is the solution. Without a child theme, every modification you make to your theme’s files is overwritten when the theme developer releases an update. With a child theme, your customisations live in a separate directory that the parent theme update never touches.
Why You Need a Child Theme
Your customisations survive updates. When your parent theme updates (which it should, regularly, for security and compatibility — see our safe update guide), only the parent theme’s files are replaced. Your child theme files — containing your customisations — remain untouched.
You can safely experiment. If a child theme modification breaks something, you can simply delete the problematic file from the child theme and WordPress falls back to the parent theme’s original version. You cannot break the parent theme by modifying the child.
It is WordPress best practice. The WordPress Developer Handbook explicitly recommends child themes as the correct way to modify a theme’s behaviour. Any WordPress developer or maintenance service (including our maintenance team) expects customisations to be in a child theme.
Step 1: Create the Child Theme Directory
Connect to your WordPress installation via FTP, SFTP, or your hosting file manager. Navigate to /wp-content/themes/. Create a new folder for your child theme. The naming convention is [parent-theme-name]-child. For example, if your parent theme is “flavor” the child theme folder would be flavor-child. If your parent theme is “flavor” the child theme folder would be flavor-child. If your parent is “flavor” the child would be flavor-child.
Examples: parent theme “flavor” → child folder flavor-child, parent theme “flavor” → flavor-child, parent theme “flavor” → flavor-child.
Step 2: Create the style.css File
Inside your new child theme directory, create a file named style.css. This file must contain a specific header that tells WordPress this is a child theme and identifies its parent. Here is the template:
/*
Theme Name: Your Theme Child
Theme URI: https://yourdomain.com
Description: Child theme for Your Theme
Author: Your Name
Author URI: https://yourdomain.com
Template: parent-theme-folder-name
Version: 1.0.0
*/
The critical line is Template: parent-theme-folder-name. This must exactly match the folder name of your parent theme in /wp-content/themes/ — not the theme’s display name, but the actual directory name. It is case-sensitive. If your parent theme folder is flavor, the Template line must say Template: flavor.
After the header, you can add any custom CSS you want. This CSS will be loaded after the parent theme’s CSS, so your styles will override the parent’s styles for any matching selectors.
Step 3: Create the functions.php File
Create a file named functions.php in your child theme directory. This file must enqueue (load) the parent theme’s stylesheet. Without this step, your child theme will not inherit the parent’s styling — it would display with no CSS at all.
<?php
function child_theme_enqueue_styles() {
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style'));
}
add_action('wp_enqueue_scripts', 'child_theme_enqueue_styles');
This code does two things. It loads the parent theme’s stylesheet (get_template_directory_uri() points to the parent theme’s directory). Then it loads the child theme’s stylesheet (get_stylesheet_directory_uri() points to the child theme’s directory) with the parent style as a dependency — ensuring the parent’s CSS loads first and the child’s CSS loads after, allowing your customisations to override.
Important note for themes that use multiple stylesheets: Some themes (particularly those built with page builders or using complex CSS frameworks) load their main styles from a file other than style.css — for example, from a compiled CSS file in an assets directory. Check your parent theme’s functions.php to see how it enqueues its styles. You may need to adjust the handle name in your enqueue function to match.
Step 4: Activate the Child Theme
Go to your WordPress admin dashboard. Navigate to Appearance → Themes. You should see your child theme listed alongside other installed themes. If it does not appear, double-check that both style.css and functions.php exist in the child theme folder, and that the style.css header has the correct Template value.
Click “Activate” on your child theme. Your site should look exactly the same as before — because the child theme inherits everything from the parent. If your site looks broken (no styling), the functions.php enqueue is not loading the parent’s CSS correctly. Deactivate the child theme and review Step 3.
Step 5: Customise Your Child Theme
Now that your child theme is active, you can safely make customisations that will survive parent theme updates.
Custom CSS
Add CSS rules to your child theme’s style.css file (after the header comment). These rules override the parent theme’s styles. For example, to change all H2 headings to a different colour, add h2 { color: #2563eb; } to your child theme’s style.css. You can also add custom CSS through Appearance → Customize → Additional CSS, which is stored in the database rather than in theme files — but for significant CSS customisations, the child theme’s style.css is the more maintainable location.
Override Template Files
To modify a specific template file (header.php, footer.php, single.php, page.php, etc.), copy the file from the parent theme’s directory to your child theme’s directory and edit the child’s copy. WordPress will use the child theme’s version instead of the parent’s. For example, to customise the header, copy /wp-content/themes/parent-theme/header.php to /wp-content/themes/parent-theme-child/header.php and edit the child’s copy.
Only copy files you need to modify. Do not copy the entire parent theme into your child theme. WordPress falls back to the parent theme for any file not present in the child — so only include files you have actually changed.
Add Custom Functions
Your child theme’s functions.php is loaded in addition to (not instead of) the parent theme’s functions.php. This means you can add new functions, hook into WordPress actions and filters, register new widget areas, add custom shortcodes, and modify the parent theme’s behaviour using hooks — all without touching the parent’s files.
Common Child Theme Customisations
Adding Google Analytics or tracking code. Add your tracking script to the child theme’s functions.php using the wp_head or wp_footer action hook, rather than editing the parent’s header.php.
Modifying the header or footer layout. Copy header.php or footer.php from the parent to the child and modify the child’s copy.
Adding a custom page template. Create a new PHP file in your child theme with a template header comment at the top. It will appear as an option in the Page Attributes dropdown when editing pages.
Removing unwanted theme features. Use remove_action() or remove_filter() in your child theme’s functions.php to unhook functions that the parent theme registers. This is cleaner than editing the parent’s code.
Using Child Themes with Page Builders
If your site uses Elementor, Divi, Beaver Builder, or another page builder, child themes still apply — but most of your visual customisations are stored in the database by the page builder, not in theme files. A child theme is most useful alongside page builders for CSS overrides that affect the entire site (typography, colours, spacing), for modifying theme template files that the page builder does not control (header, footer, archive templates), and for adding custom PHP functions.
Elementor’s Theme Builder and Divi’s Theme Builder can replace traditional template files — but the child theme remains the safest place for custom code and CSS that should persist across theme updates.
Frequently Asked Questions
Do I need a child theme if I only use the WordPress Customizer?
Settings made through the WordPress Customizer (Appearance → Customize) are stored in the database, not in theme files. They survive theme updates without a child theme. However, if you add CSS through the Customizer’s “Additional CSS” section and it grows beyond a few rules, moving it to a child theme’s style.css is more maintainable. And any template file modifications or custom functions always require a child theme.
Will a child theme slow down my site?
Negligibly. A child theme adds one additional CSS file to load and one additional functions.php to execute. The performance impact is typically unmeasurable — far less than a single unoptimised image. For performance concerns, focus on the optimisations in our WordPress speed guide.
Can I create a child theme for any WordPress theme?
Yes. Every WordPress theme can be a parent theme. However, some themes — particularly multipurpose themes with complex option panels — may have specific child theme guidance in their documentation. Check your theme’s docs for any child theme instructions or starter files. Many premium themes provide a blank child theme download as a starting point.
I already made changes to my parent theme. How do I move them to a child theme?
Create the child theme following Steps 1–4 above. Then, for each customisation you made to the parent theme, recreate it in the child theme — copy modified template files, move custom CSS, and transfer custom functions. After activating the child theme and verifying everything works, update the parent theme to restore its original files (this replaces your modifications with clean originals, which is fine because the customisations now live in the child theme).
What happens to my child theme if I switch parent themes?
A child theme is specifically linked to one parent theme (via the Template line in style.css). If you switch to a completely different parent theme, you need a new child theme for that parent. Your old child theme becomes inactive but remains in your themes directory — you can reactivate it if you switch back.
Need Expert Help? Let WP Ministry Handle It
Creating a basic child theme is straightforward. But when customisations become complex — modifying multiple template files, overriding theme functions, ensuring compatibility with page builders, and maintaining everything through parent theme updates — having professional support matters.
Our custom development service builds and maintains child themes as part of larger WordPress projects. Our maintenance team ensures your child theme remains compatible with parent theme updates through regular testing on every care plan.
View our care plans → or call (901) 249-0909.
Related Articles
How to Add Custom CSS to WordPress (5 Methods)
How to Safely Update WordPress (Core, Plugins, and Themes)
How to Fix WordPress Plugin Conflicts (Troubleshooting Guide)