How to Create a Child Theme in WordPress (Step-by-Step Guide)

Creating a child theme is the simplest way to modify or customize your WordPress theme without altering the original theme. In this tutorial, we will cover how to create a child theme in WordPress, how it works, and the reasons to use one.

Updated on

Do you want to create child theme for your WordPress website or WooCommerce store? If so, keep reading this article for a complete tutorial on creating custom child theme for WordPress.

You’ll find thousands of themes in the WordPress themes repository. These themes have excellent features and functionalities by default, but to make your website unique as per your requirements, customization is key.

You can enhance the theme’s features with some custom CSS and a few code snippets.

But how can you customize your WordPress theme effectively?

The answer is with the help of a child theme.

If you are wondering about creating, managing, and troubleshooting WordPress child themes? You’re in the right place!

Here, we’ll show you everything you need to know about creating WordPress custom child themes, how a child theme works, and how to customize it in this beginner-friendly guide.

But first, it’s important to understand the key differences between a parent theme and a child theme.

What Is the Difference Between Parent and Child WordPress Themes?

A parent theme in WordPress is a complete theme that includes all the necessary files and templates needed to run a WordPress site.

It controls the design, layout, and functionality of your website.

A child theme, on the other hand, is like an extension of the parent theme. It depends on the parent theme to function, but allows you to make changes and customizations without altering the original theme files.

This way, when the parent theme gets updated, your changes in the child theme won’t be lost.

In short, the parent theme is the base, and the child theme is used to safely add your tweaks and styles on top of it.

When to Use a WordPress Child Theme?

Creating a WordPress child theme becomes necessary when you want to make changes to your site’s design or functionality without touching the core files of the original (parent) theme.

This approach ensures that your customizations remain safe even when the parent theme receives updates.

An internal study by Elegant Themes revealed that 85% of their customers customize their themes, but only 35% use a child theme for these customizations. This indicates that while many users value the flexibility and security that child themes offer, a significant portion still foregoes them.

It can be safely assumed that 50% of users who customize their site without a child theme may have experienced the loss of their work when updates were applied.

Here are some situations in which a child theme will come in handy:

  • Make Custom Design Tweaks: Whether it’s minor CSS changes or complete layout overhauls, using a child theme allows you to safely edit styles and templates without altering the main theme’s files.
  • Prevent Update Conflicts: When the parent theme is updated, any direct changes made to its files will be lost. A child theme protects your edits from being overwritten during updates.
  • Add or Modify Functions: If you want to add custom PHP functions or remove default functionalities, do it within the child theme’s functions.php file keeps things clean and safe.

In the next section, we’ll show you how to create a child theme for your website.

How to Create Child Theme in WordPress
How to Create a Child Theme in WordPress

How to Create Child Theme in WordPress

There are three main methods you can follow to create a child theme on your WordPress website:

  • Manual method
  • Using a dedicated plugin
  • With the help of an online tool

All these methods are beginner-friendly, and you can easily create child theme folder and start the theme customizations with ease.

Without further ado, let’s begin with the step-by-step instructions on setting up a child theme on the website.

Pro Tip: I would recommend you to create a full backup of your site before starting the process of creating a child theme on your WordPress site. Having a backup is important and can save you a lot of time if anything goes wrong.

1. Manual Method

If you need to create the child theme yourself, follow this method. You either need to use an FTP client or a file manager plugin. Because we will be dealing with creating new folders, files, etc.

In our case, we will use a file manager plugin for the task.

Now, go to your WordPress root directory, then go to the themes directory wp-content/themes, and create a folder there for your child theme, i.e., gp-child.

new folder created
New folder created

Now, you need to create a style.css file and paste the following code:

/*
Theme Name: GP Child
Theme URI: https://your-domain.com/theme-url/
Description: GeneratePress Child Theme
Author: Johnson
Author URI: https://abc-domain.com
Template: generatepress
Version: 1.0
Tags: single-columns, red, black, responsive
*/

/*
* Your custom css below 
*/

You need to replace the theme name, URLs, template name, and so on with your preferred options. Once you have done that, you need to create a functions.php file and call your parent theme.

<?php
//
function tn_theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
add_action ( 'wp_enqueue_scripts', 'tn_theme_enqueue_styles' );

//
// Your code goes below
//
save functions file
Save functions file

Now, you can go to the themes section and see the child theme there.

new child theme created
New child theme created

Activate it and start customizing it.

The child theme won’t have any featured image. To get one, you can upload it to the folder and call it screenshot.png.

That’s it!

This is how you can create child theme in WordPress manually.

In any case, if you are not able to use/access the file manager plugin to develop the child theme.

Follow the same steps on your computer locally:

  • Create a new folder for the child theme.
  • Within this folder, add the style.css and functions.php files.
  • Compress the entire folder into a .zip file.
  • Log in to your WordPress site and navigate to Appearance > Themes.
  • Upload the compressed .zip file to activate your child theme, that’s it.

2. Plugin Method

If you need to use a dedicated plugin to create child theme for your website, follow this method.

For this tutorial, we will be using the WP Child Theme Generator plugin. Once you have installed and activated the plugin, you will find its settings under the ‘Appearance’ section.

child theme gen settings
child theme gen settings

Next, the plugin will ask for the parent theme. In the dropdown, you can see all the available themes. Pick one according to your needs.

choose the theme
Choose the theme

Now, you can enter the theme details, such as the theme name, author name, theme description, and optional information like theme URL, Version, tags, etc.

child theme details
child theme details

After that, you can create the child theme. Now, go to the Themes section, and you’ll see the newly generated custom child theme there.

gp child theme activated
GP child theme activated

You can activate it from there.

3. Online Child Theme Generator

There are a few online child theme generator websites available. For example, check this website. In the box, you can search for the parent theme.

search theme
search theme

The tool will take care of the theme slug and enqueue all the important files. Next, you need to name the child theme, set up the child theme slug, author name, and so on.

theme name
theme name

Once you’re done, you can create the child theme.

NOTE: Some WordPress themes, such as Astra, come with a custom Astra child theme generator. So, if you are using Astra as the parent theme, feel free to use the Astra child theme generator to create your custom child theme.

Pros and Cons of Using a Child Theme

Next, let’s look at some of the main advantages and disadvantages of activating a child theme.

ProsCons
Safely customize without losing changes during parent theme updatesRequires basic knowledge of WordPress file structure
Helps organize custom code and styles separatelyMay cause issues if the parent theme updates with breaking changes
Easier to troubleshoot or revert custom changesSome advanced features might need extra functions or tweaks
Ideal for extending the functionality of third-party themesToo many customizations can lead to performance issues if not optimized properly
Encourages best practices in theme developmentDependency on parent theme, if it’s poorly coded, it affects the child theme too

In the next section, we’ll show you some common issues you may face after using a child theme on your website.

Troubleshooting Most Common WordPress Child Theme Issues

While child themes offer a great way to customize your site without modifying the original theme, users can sometimes encounter issues, especially if they’re new to theme development.

Below, we have listed a few of the main issues you can face on the go and how to fix them.

1. Changes Not Reflecting on the Frontend

One of the most common issues is when CSS styles or design elements do not appear as expected. This often happens due to browser cache. Always clear your browser cache or use incognito mode to check if your edits are being applied. You can also follow this guide on CSS cache buster to fix this issue.

2. Broken Layouts After Theme Update

When the core theme files of the parent theme get updated, it can sometimes conflict with how your child theme is structured, especially if you’re overriding outdated templates. Always test your update process in a staging environment before applying it live.

3. Incorrect File Path or Missing Files

If you notice an error message or missing image files (like a broken featured image), it’s worth checking your file paths. A typo or incorrect directory structure in your child theme can cause files to not load properly.

4. Custom PHP Not Working

If you’ve added custom functions in your child theme’s functions.php and they aren’t working, you might have missed a PHP closing tag or introduced a syntax error. Even a small mistake here can prevent WordPress from loading properly.

5. Style Sheet Not Loading Correctly

If your CSS doesn’t seem to apply, ensure your child theme’s style.css is properly enqueued and doesn’t rely on outdated hooks. Improper loading of the style sheet is one of the most overlooked issues in a basic child theme.

Bonus: Best WordPress Child Theme Generator Plugins

As you can see above, using a plugin for creating a child theme is efficient and simple.

Here are the top plugins you can use for this task:

Frequently Asked Questions

In this section, we’ll explore some frequently asked questions and their answers related to this topic.

Do I need to copy all template files in Child theme from parent?

No, you only need to copy specific template files that you want to customize. When WordPress loads your site, it checks the child theme directory first. If it doesn’t find a particular file there, it falls back to the parent theme. This makes it easy to modify only what you need without duplicating the entire structure.

What is a child theme folder in WordPress?

A child theme folder is a dedicated directory inside your WordPress wp-content/themes folder that holds the files specific to your child theme. It typically includes at least a style.css file and a functions.php file, allowing you to override or extend the parent theme without altering the original files.

Can I customize the design using only CSS in a child theme?

Yes, absolutely. You can add your own custom CSS inside the style.css file of the child theme. This allows you to style elements differently from the original theme without touching the parent theme folder. It’s one of the safest ways to tweak the visual look of your site.

What happens if the parent theme updates?

When the parent theme is updated, none of your child theme files will be affected. That’s the main benefit of using a child theme is you keep all your changes in a separate theme, so they remain intact even after a parent theme update.

Can I add custom PHP functions in a child theme?

Yes, you can include custom functions by adding them to the functions.php file in your child theme folder. This is a good way to extend functionality without editing the parent theme files. Just make sure your code snippet is clean and doesn’t conflict with existing functions.

How do I create child theme without touching code?

If you’re not comfortable editing style sheets or PHP files manually, you can use a child theme plugin to generate the child theme directory automatically. It’s a convenient method that creates all the necessary theme files for you with just a few clicks in the admin panel.

Is using the Theme Customizer enough instead of a child theme?

While the theme customizer is great for basic styling and layout changes, it has its limits. If you want full control over template files, custom style, or advanced functionality, creating a custom theme with a child theme gives you much more flexibility.

What are classic child themes in WordPress?

Classic child themes refer to traditionally structured themes where users manually create the child theme folder, add necessary CSS files, and include custom functions as needed. This approach is preferred by developers who want maximum control over the current theme and its interaction with the parent theme.

How to know if I already have a WordPress Child Theme?

In your WordPress admin, go to Appearance → Themes to identify the “active theme”. A child theme will often include “child” in its name and have a featured image similar to the parent theme’s featured image, or both. To ensure it further, you can check the wp-content/themes directory. A child theme folder may exist but not load due to issues in the style.css or functions.php files. In that case, you should follow the child theme troubleshooting points to resolve any problems.

Conclusion

Creating a child theme in WordPress is a smart move for anyone who wants to take more control over their website without modifying the original template files.

Whether you’re using a third-party theme or building your own, working within a child theme folder allows for safer and more flexible customization. Tools like a child theme plugin can speed up the process, especially if you’re new to theme development.

With a child theme, you can tweak theme options, experiment with CSS code, or even add custom PHP code, all while keeping the parent theme intact.

This makes child theme creation not just a best practice for theme developers, but also a way to avoid common errors that come with editing core files.

Even if you’re working with just a few lines of code, the benefits are clear: long-term site stability and easier updates.

In short, creating a separate child theme is a small step that brings big value, especially when it comes to managing updates, improving performance, and building a unique design safely and efficiently.

Do you know any other method to create child theme in WordPress?

Let us know in the comments.

Photo of author
Saurabh K
Web dev with a knack for content writing, speed optimization, SEO, and WordPress magic. By day: building fast, beautiful sites. By night: chasing coffee and ideas for my next technical write-up.
Disclaimer: Affiliate links of some product(s) are being used on this page, if you follow the link and make a purchase, we may receive compensation from respective companies. This compensation comes at no additional cost to you.

6 thoughts on “How to Create a Child Theme in WordPress (Step-by-Step Guide)”

  1. Avatar of Narendra

    Very brilliantly explained. I hope it will help me to get blog of my desire. Thanks Saurabh K.

    Reply
  2. Avatar of Ray Boller

    Thanks for the instructions. It helped me to create child template.

    Reply
  3. Avatar of Robina

    I have added the code but it’s not working

    Reply
    • Avatar of Saurabh K

      You can use the plugin instead.

      Reply
  4. Avatar of jak

    I successfully set-up the child theme as you described. Much obliged.

    Question: If I need to modify the code in other files of the parent (comments section for WordPress, for instance), do I just copy the original parent file, put it in the child folder, and then add the additional code to it? Or, do I have to modify it differently like you did with the style and functions files?

    If you have a blog about this, then I’d welcome reading it. Ultimately, I’d like to add those little check boxes that you have below the comments section too (without using a plugin).

    Reply
    • Avatar of Saurabh K

      It’s great to see that you find the information useful.
      I would not advise you to edit any file in the parent theme folder. Instead, you should create a copy of the file in the child theme folder before you edit it.

      Reply

Leave a Comment

Your email address and website details will not be published. Required fields are marked with *.