Table of Contents
How to Create a WordPress Child Theme: A Complete Guide
If you have ever customised a WordPress website only to watch all your hard work disappear after a theme update, you will understand exactly why WordPress child themes are so important. Creating a child theme is one of the smartest things you can do as a WordPress site owner or developer. It protects your customisations, keeps your site secure, and gives you the freedom to make changes without touching the parent theme’s core files.
In this guide, we will walk you through everything you need to know about creating a WordPress child theme, from understanding what one actually is to getting it set up correctly on your hosting environment. Whether you are a beginner or a seasoned developer, this step-by-step tutorial will help you get things right the first time.
What Is a WordPress Child Theme?
A WordPress child theme is essentially a theme that inherits the functionality, features, and styling of another theme — known as the parent theme. Rather than modifying the parent theme directly, you make all your changes within the child theme. When the parent theme is updated, your customisations remain completely intact because they live in a separate set of files.
This is the recommended approach for any WordPress customisation. Even if you are only changing a small CSS rule or adding a custom function, doing so through a child theme is best practice and will save you a great deal of frustration in the long run.
Why WordPress Child Theme Hosting Matters
Before diving into the technical steps, it is worth discussing the importance of WordPress child theme hosting. The hosting environment you choose has a direct impact on how smoothly your child theme performs. A quality hosting provider will offer the right PHP version, sufficient file permissions, and reliable server speeds — all of which are essential when you are developing and deploying a child theme.
Poor hosting can lead to slow load times, permission errors when uploading theme files, and compatibility issues that make debugging a nightmare. When selecting a host for your WordPress site, always look for one that supports the latest version of PHP, offers easy file management via cPanel or SFTP, and provides staging environments so you can test your child theme before going live.
For further reading on choosing the right hosting setup for your WordPress projects, take a look at the helpful resources available at da-manager.com/blog.
What You Will Need Before You Start
To create a WordPress child theme, you will need the following:
- A WordPress website that is live or running locally
- An active parent theme already installed (such as Twenty Twenty-Four or Astra)
- Access to your website’s files via FTP, SFTP, or a file manager in your hosting control panel
- A basic text editor such as Notepad++, Sublime Text, or Visual Studio Code
Step-by-Step: How to Create a WordPress Child Theme Manually
Step 1: Create a New Folder for Your Child Theme
Using your FTP client or hosting file manager, navigate to the wp-content/themes/ directory on your server. Inside this folder, create a new directory for your child theme. It is good practice to name it after the parent theme with “-child” appended. For example, if your parent theme is called “astra”, name your child theme folder “astra-child”.
Step 2: Create the Style Sheet
Inside your newly created child theme folder, create a file called style.css. This is the most important file in your child theme. Open it in your text editor and add the following header information at the very top:
/* Theme Name: Astra Child Theme URI: https://yourwebsite.co.uk Description: A child theme for the Astra theme Author: Your Name Author URI: https://yourwebsite.co.uk Template: astra Version: 1.0.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: astra-child */
The most critical line here is Template:. This must match exactly the folder name of your parent theme. If it does not match, WordPress will not recognise the relationship between the two themes.
Step 3: Create the Functions File
Next, create a file called functions.php in your child theme folder. This file is used to enqueue the parent theme’s stylesheet so that all the original styles are loaded correctly. Add the following code:
<?php
function my_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', 'my_child_theme_enqueue_styles');
This ensures that both the parent and child stylesheets are loaded, with the child theme’s styles taking priority over the parent’s.
Step 4: Activate Your Child Theme
Log in to your WordPress dashboard and navigate to Appearance > Themes. You should now see your child theme listed alongside the parent theme. Click Activate to make it live. Your website should look exactly the same as before, which means everything is working correctly.
Step 5: Start Customising
Now that your child theme is active, you can begin making customisations. Any CSS you add to your child theme’s style.css will override the parent theme’s styles. Similarly, any functions you add to functions.php will extend or override those in the parent theme.
You can also create template files within your child theme folder to override specific page templates from the parent theme. For example, if you want to customise the way single blog posts are displayed, simply copy the single.php file from the parent theme into your child theme folder and edit it there.
Using a Plugin to Create a Child Theme
If you are not comfortable working with files directly, there are several WordPress plugins that can create a child theme for you automatically. Plugins such as Child Theme Configurator or One Click Child Theme allow you to generate a child theme with just a few clicks from within the WordPress dashboard. While this method is quicker, understanding the manual process is still highly recommended so you know what is happening under the hood.
Common Mistakes to Avoid
Incorrect Template Name
As mentioned earlier, the Template: value in your style.css header must exactly match the parent theme’s folder name. Even a small typo will prevent the child theme from working properly.
Not Testing Before Going Live
Always test your child theme in a staging environment before pushing changes to your live site. Many hosting providers offer staging tools, and this is one area where good WordPress child theme hosting truly makes a difference.
Editing the Parent Theme Directly
Even with a child theme set up, some developers fall into the habit of making small edits directly to the parent theme. Resist this temptation entirely. All changes should be made within the child theme to ensure they are preserved through updates.
Final Thoughts
Creating a WordPress child theme is a straightforward process that offers enormous benefits in terms of flexibility, security, and long-term maintainability. By following the steps outlined in this guide, you can protect your customisations and build upon any parent theme with confidence.
Remember that the quality of your WordPress child theme hosting plays a significant role in how well your theme performs. Invest in a reliable hosting provider, keep your WordPress installation and themes updated, and always develop within a child theme rather than modifying the parent directly. These habits will serve you well throughout your WordPress journey.














