How to Create a Child Theme in WordPress? Whenever you’re looking to modify your WordPress theme, everyone will advise you to create a child theme. That way, you can easily make the modifications, and whenever you want to revert to the original theme, you can easily do so.
Before creating a child theme, we highly recommend using the Astra Theme (free for most options), since it’s a super light and comfortable theme to use
creating a child theme?
right now, we will help you understand how to create one and why you need one as well.
Once you go through the step-by-step tutorial below, creating a child theme and utilizing it to its fullest will be easy.
How to create a child theme in your WordPress?
There are essentially two different methods to create a child theme. The first one is to use a code and the second one is to use a plugin.
Do not be afraid of using the code because that is certainly easy. If you do not want to dabble in the code, you can also go through the method below, which will help you understand how to create a child theme using a plugin.
Method 1: Using a plugin:
the first method to create a child theme in WordPress is by using the plugin “Child Theme Configurator“. The plugin we will be using to create a child theme is the child theme Configurator. It is one of the popular plugins for the purpose.
Step 1: installing the plugin:
Login to your WordPress backend by visiting https://yourdomain.com and entering the relevant details, and pressing enter.
Step 2: Install the plugin:
To install the plugin, you have to click the plugins option from the left side dashboard and click add new. The page will provide you with the search option to search the plugin’s name you want to install. You have to type in “Child Theme Configurator.” Once it appears in the search results, you have to click on the install now option and then activate it.
Step 3: Go to the Child Themes page:
To create a child theme using the plugin, you have to click the tools option from the sidebar and select the Child themes option.
Step 5: create the child theme:
Once the analysis is complete, a green tick mark will appear below the drop-down menu in which you selected the theme name. It will display the message that the theme you have selected is proper for creating a child theme. After this message appears, you have to scroll down to the bottom and click on the “Create New Child Theme” button.
There is no need to work on the other settings between the drop-down menu and this button.
Step 6: activate the child theme:
After that, you have to activate the child theme by clicking on appearance from the sidebar and then themes. You will get the name of the theme followed by the word ?child.’ You have to click on the activate button on that team.
That’s it!
In these six simple steps, you can create and activate a child theme on your WordPress website.
Of course, using the plugin is quite easy.
Now that you are aware of how to create a child theme, it is important to understand why one is needed in the first place.
Method 2: Using code:
Another way to create a child theme in WordPress is by code. In this method, the code is used to a limited extent. Apart from that, you will need cPanel details as well.
The step-by-step method below will help you create a child theme in no time.
Step 1: Login through FTP or Cpanel:
o create a child theme using code, you can either log in using the cPanel and then visit the file manager folder or log in using an FTP client and click on public HTML.
In both cases, you will need your cPanel ID and password.
Step 3: Create and name the folder:
Creating a folder is similar to what you will use on your computer. You can name it almost anything. Here, we will be naming it wpbdemo.
Step 4: Saving the code in the folder:
Once you have created that folder, it is time to save the code in that folder. For the same, you have to open something like a notepad and save the code.
The code you need to save is:
Theme Name: WPB Child Theme
Theme URI: https://yourdomain.com/
Description: A Twenty Twenty-One child theme
Author: yourname
Author URI: https://yourdomain.com
Template: twentytwentyone
Version: 1.0.0
Text Domain: twentytwentyonechild
Before saving this code, you have to replace “yourdomain.com” with your site and “yourname” with your actual name.
The entry in front of the “template” field would be the exact name of the theme whose child theme you want to create. Similarly, “Theme Name” field entry can also be changed according to what you want to name the child theme.
The import line in the code will use the stylesheet from the original theme.
After making the necessary changes, save this notepad file and name it style.css. You have to paste this file into the folder you created on your website.
Step 5: Activate the child theme:
By now, the process of creating a child theme is complete. Now you have to activate it.
For the same, you have to log in to the WordPress backend. You can visit the URL https://yourdomain.com/wp-admin to view the user ID and password box. Once you enter that and press enter, you can log in to the WordPress backend.
After that, from the sidebar, click appearance and then themes.
The child theme will also show up in the list of themes available on your WordPress website. In this case, the theme’s name will be “WPB Child Theme.” You have to click activate.
That’s it!
You can create a child theme on your WordPress website in these few simple steps.
Sounds confusing?
If so, you can use a few plugins to create a child theme. That way, you won’t have to worry about dealing with any code while creating a child theme on your WordPress website.
1. Easy development of a theme:
Even though there are hundreds of thousands of WordPress themes to choose from, after installing one, you will have to customize it to build your site right.
Instead of customizing the parent theme, it is good to customize a child theme. If anything goes south, you can always revert to the parent theme without having to install it once again.
2. the customizations will not be lost
Whenever a new update of your WordPress theme is available, updating the same means that all the customizations which you have made to the theme will be lost. However, when using a child theme, you can customize it as much as you want. Whenever the update is available, you can update the parent theme.
That way, the child theme will gain the new updates and features of the parent theme, but the customizations will not be lost.
The retention of changes is one of the main reasons developers often use child themes.
3. Easy to create similar sites:
You can easily download the child theme and directly install it on other websites as well. That way, you will not have to make these modifications on all the websites.
Since you will be installing the parent as well, there is no need to call the theme from scratch. That way, it is certainly easier to create similar websites when you’re using the child theme.
These are the four main reasons why it makes perfect sense to install child themes on WordPress.
Are child themes necessary?
No, child themes are not necessary because they can help you in many different scenarios and make the development much easier BUT only if you need to modify theme code or files.
Why to using a child theme in WordPress?
The purpose of the child theme is to help you with the customization of the website and also ensure that no changes are lost when the parent theme is updated. Moreover, it helps you in creating other similar websites as well without having to make the customizations again and again.
What is the limitation of a child theme?
The limitation of the child theme is that it is dependent on the parent theme. In case, in a new update, the developer drops a feature altogether, the child theme will not be able to run that feature.
Conclusion of "How to Create a Child Theme in WordPress?":
Using any of the methods, you can easily create a child theme within a couple of minutes. Sure enough, the code might seem a bit complicated, but if you take a look at it, it is easy to create the right file using that code. In case you want a beginner-friendly method, simply use the plugin we have highlighted above, along with the steps I highlighted to create the child theme.
You need not bother about how to create a child theme; the next time around, you’re building a WordPress website.
We hope this “How to Create a Child Theme in WordPress?” helped answer your questions, feel free to ask anything else in the comments