Every WordPress website uses a ‘theme’ that controls the appearance and layout of the site. But the problem is that any customizations that you make to the parent theme are lost when the theme is updated since WordPress deletes that theme’s files and replaces them with the updated version
The solution lies in creating a child theme that inherits the stylesheet of the parent theme. Any customizations added to the child theme are retained when the parent theme is updated.
A child theme usually contains two primary files: style.css and functions.php. Both these files are fully editable and all the modifications like custom CSS and PHP code that are added to the style.css and functions.php files respectively are immune from the updates made to the parent theme.
For these reasons, it is always advisable to create and activate a child theme on your website. Fortunately, creating a WordPress child theme is, well, a child’s play.
How to Create Child Theme in WordPress
Below, I will share the exact steps to create a child theme in WordPress in less than 5 minutes using just 3 steps.
Step 1: Install the Child Theme Configurator plugin
There is a manual way to create child themes if you know some PHP and can work with certain WordPress files.
However, the manual method of creating a child theme is tedious and time-consuming. It is far easier and quicker to use a plugin to create a child theme. Also, you can simply delete the plugin once you have created the child theme.
So, without wasting further time, install and activate the free Child Theme Configurator plugin.
Then navigate to its settings panel from Tools > Child Themes in your WordPress dashboard.
Step 2: Configure the Child Theme Configurator plugin
The plugin’s settings panel is neatly organized into multiple tabs.
The radio button to create a child theme is already selected by default. You now need to select the parent theme whose child theme you wish to create.
In my case, I have selected the GeneratePress theme since that’s what we use on PassionWP (you can also read my GeneratePress theme review).
Now, click the Analyze button to allow the plugin to check for the required files and potential conflicts.
Step 3: Finish setting up the child theme
If everything’s ok, you should see this success message.
You can now just skip to the last step and click the Create New Child Theme button if you don’t need to edit any of the pre-selected settings. But if you do, you can continue reading below.
In step 4 of the plugin settings, you can change the name of the child theme directory. Since I am creating a child of the GeneratePress theme, my default directory name is generatepress-child.
You can name it to whatever you want, all lowercase characters and hyphen between words.
In step 5, you are required to select the location where the new custom styles will be saved.
You can choose between Primary Stylesheet (default) or Separate Stylesheet. If you select the primary stylesheet, then the custom styles that you create will overwrite any existing styles in this stylesheet.
If you select the separate stylesheet, then your custom styles will get saved to a separate stylesheet preserving the existing child theme styles instead of overwriting them.
But since you’re creating a new child theme, there will be no values in the primary stylesheet of your child theme. That’s why you should go with the Primary Stylesheet option.
In step 6, you need to select the parent theme stylesheet handling. This setting determines how your parent theme’s style.css file will be handled.
The default value is set to: Do not add any parent stylesheet handling. Leave this untouched unless you want to explicitly change the way your parent theme’s style.css file is handled.
In step 7, you can modify the following attributes of the child theme:
- Child theme name
- Website URL
- Author website
- Theme description
- Theme tags
You can leave all of this unchanged or modify the information as you like.
In step 8, you can choose to copy the menus, widgets, and other Customizer settings from the parent theme to the child theme. This option is useful if you already have made customizations to your parent theme and wish to copy them to the child theme.
If you made only minor changes or no changes at all, you can skip this setting.
Once everything is complete and you’re satisfied with the settings, click the Create New Child Theme button.
Hurray, your brand new child theme has been successfully set up. You can now click the preview child theme link to ensure that the preview looks the way you intended it to.
Your child theme will now show up in the Appearance > Themes panel. Go ahead and activate your child theme to start using it.
Using a child theme in place of the parent theme for making theme edits and customizations is a recommended practice. Fortunately creating a child theme in WordPress takes under 5 minutes using the steps described on this page. If you found this tutorial useful, kindly share it on your favorite social platform.
Download the WordPress SEO eBook
Go from WordPress SEO Zero to Hero in no time. Also receive 2 Bonus PDFs with this free eBook.
Give it a try. You will thank yourself later.