We are here to learn How to Create Child Theme in WordPress, A child theme is derived from Parrent theme of WordPress which inherits all the functionality, features, style and other parts of the parent theme. A child theme is the best and safe way of update/modifying a WordPress theme without touching parent. to understand the How child theme worked and how to create a child theme from the parent theme.
A parent theme is a complete WordPress theme which consists of all files excluding child themes is know as a parent theme.
a child theme is inherited from parent theme which looks exactly the same as parent theme which helps to override the changes of parent theme without any effect on parent theme. using child theme let you allow any upgrade of parent theme without any loss of any customization which takes place into a child theme.
Follow these steps to create a child theme from a parent theme.
Step 1: First create a new folder into WordPress themes directory wp-content/themes/twentyfifteen-child
Note: I am making a child theme for twentyfifteen, you can do for themes accordingly, the best practice is to add a hyphen(-and child) into existing theme name.
Step 2: Create style.css into a child theme directory and import the parent style sheet by import function
Theme Name: Twenty Fifteen Child
Theme URI: https://www.solutionshint.com
Description: Twenty Fifteen Child
Author: Hozaifa Sheikh
Author URI: Twenty Fifteen Child
License: GNU General Public License v2 or later
Text Domain: twentyfifteen-child
Step 3: Now go to your WordPress admin panel and activate the child theme
Step 4: congratulation you have successfully created a child theme from twentyfifteen.