How to Create a Child Theme in WordPress
What is Child Theme
A WordPress child theme is a theme that inherits its functionality from the parent theme. It gets all the code from the parent theme. When you do any customization in the WordPress theme according to your need. After that, it will be a difficult task for you to update the newest version of the theme. Because when you update the theme all the customize code will be overwritten by the theme update. And you will be lost your entire modified code. So to keep your changes separate from the theme update there is a requirement of the child theme. A Child Theme keeps all your customized code safe from the new theme update. And you can add your own functionality in the child theme that won’t effect your parent theme.
How to Create a Child Theme in WordPress
There are two ways to create a child theme in WordPress
- Create the child theme manually without use of any plugin
- Create the child theme with use of a plugin
Create Child Theme Manually
Step1: Create a new folder in your themes directory, located at wp-content/themes. And name the folder anything you want.
Step2: Create another file style.css and write the code, which are given below.
/* Theme Name: Twenty Fifteen Child Description: Twenty Fifteen Child Theme Template: twentyfifteen */
Step3: Create a file name function.php and use the code which is given .
Step4: Now Activate the created child theme from your dashboard
Create a Child Theme Using Plugin
If you do not want to create child theme manually by using the codes. Don’t worry there are a lot of wordpress plugins with the help of that you can easily create child theme. Eg- One-click child theme, Child-themify etc. You can use any of them. Here i am using child-themify.
Step1: Goto Admin dashboard and click on add new plugin. And install Child Themify plugin
Step2: Goto your theme files and click on active theme and you will find create child theme button click on it.
Step3: Select the parent theme and enter the name of your child theme and click to create child theme button.
Step4: Now goto your theme files and you will find a newly created child theme.
Step5: Click to activate the child theme.
These are two simple steps to create a child theme in wordpress. You can opt anyone according to your preference.