Create Child theme in WordPress

Child theme, WordPress give facility to create child theme of a parent theme. What is child theme? Child theme is one of the best option in WordPress, here child theme is interconnect with parent theme. If you have created child theme in WordPress, WordPress will locate child them first to load your website. why we need to create child theme in WordPress, while we have already installed theme? which is working perfectly. The main reason is updating WordPress software. When you update WordPress software, your running website can be damage or give some error. This is the main reason for creating child theme in word-press.

How to Create Child Theme in WordPress?

Creating a child theme is very simple, no need any CSS knowledge and any programming knowledge. Just need to follow few steps.

1- Log in to your hosting account and locate folder (wp/wp-content/theme), you will see your theme folder here. Create another new folder of same name with addition of “child”. Suppose, you theme folder name is “twenty-eleven”, create “twenty-eleven-child”.

2- After creating the folder, create a “style.css” file into the “twenty-eleven-child” folder. Open file and paste the following code in it.

 

 

/*
Theme Name: Spike
Theme URI: http://www.tutorz8.com
Description: Child theme Spike Theme
Author: mythemeshop
Author URI: http://www.tutorz8.com/
Template: spike
Version: v2.0
*/

3- Make few changes according your theme, mainly the important change is the template name, which must be the same parent directory name, in this case the template will be “twenty-eleven”.

4- After these 3 steps, you can see the new “twenty-eleven-child” theme in WordPress admin.

5- If you activate this child theme, WordPress will consider the “style.css” file as a default from “twenty-eleven-child”. Before activate it, do one more important thing, paste the following additional code into the same “style.css” file in “twenty-eleven-child” folder, and replace path with your parent theme’s path.

/*
Theme Name: Spike
Theme URI: http://www.tutorz8.com
Description: Child theme Spike Theme
Author: mythemeshop
Author URI: http://www.tutorz8.com/
Template: spike
Version: v2.0
*/

@import url(“..wp/wp-content/themes/spike/style.css”);

 

6- Child theme has been created, go to WordPress admin and go to themes option and activate the “twenty-eleven-child” theme.

Hope this article will assist you how to create child theme in WordPress

No Responses

Leave a Reply

Your email address will not be published. Required fields are marked *