How to Create and Customize Child Theme in WordPress

First of all what is Child Theme?

Child Theme is mirror image of original theme (Parent theme). No matter what ever you done or change in your child theme because it doesn’t affect the parent theme. Yes, but if the Parent theme make any changes it will visible on your child theme.

Also you have a question why should I use to Child Theme?

So let me explain It's very safest mode to use child theme because if you have any issue in your child theme then nothing to worry about that. Just deactivate your child theme and revert back to parent theme. So big it's advantage of child theme.

So let’s start to discuss about how to create child theme in wordpress.

1. Make sure your parent theme present in your Apperence ->Theme Page because without it, it will not work.

2. With your ftp or cPanel access, You can create a new folder in your theme directory. i.e. Your projectname/wp-content/themes/twentyfifteen-child. Here I can create thwentyfifteen child theme. You can choose any name whatever you like but remeber that there is no space in your folder name. It means child theme name plus -child added on the end.

3. Inside your twentyfifteen-child folder create style.css file. Open this file and paste the following code in it.

/*
 Theme Name:     Twentyfifteen Child Theme
 Theme URI:    http://www.theme.com/themes/ twentyfifteen
 Description:   Twentyfifteen  Child Theme
 Author:   Theme Themes
 Author URI:  http://www. themes.com
 Template:   twentyfifteen
 Version:   1.0.0
*/

@import url("../twentyfifteen /style.css");

Make sure that Template name should match the folder name of the parent theme and also make sure there is no blank space after the name.

4. Inside your twentyfifteen-child folder create function.php file. Open this file and paste the following code in it.

function enqueue_parent_styles() { 
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css', '', '6.1c', 'all' ); 
} 
add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles',1000 );

These two files are mandatory. You can create any file as your requirement.
Save this change and go at themes panel of your dashboard, probably you found your child theme. Activate it. Now you visit your website. It looks same when your parent theme activated.

Hopefully, you're able to create a child theme for your website. Customize your website by making change in CSS. If you still have query then comment below and i will get back to you.