WordPress Child Theme Tutorial
Adding a wordpress child theme
1. Login in to your cPanel or hosting services.
2. Get to the root folder of the site, where the wordpress installation exists. Either in the root or in the folder you have installed the wordpress.
WordPress Installed Folder
3. Head to wp-content and find themes folder.
enter in the themes folder
4. You will have to create the child theme inside the themes folder, where all the existing wordpress themes are present.
5. Create a new folder for child theme.
6. Now you need to add the style.css file in here, with the code mentioned
Create a new style sheet
Style Sheet code for wordpress child theme
Theme Name: Write the name of your theme here
Theme URI: Provide any theme URL here
Description: Description about your child theme here - For. e.g. This is a child theme
Author: You can write your name here
Author URI: Your Website or Social Page URL
Template: Provide the name of the parent theme folder, see the image above in that case "sparkling" theme was used
@import url(“../sparkling/style.css”); //See the name of the parent theme folder to be mentioned correctly.
/* =Theme customization starts here
This will help you to create child theme, now go to wordpress login panel, go to appearance>>themes>> and select your child theme.
Why to use wordpress child theme?
WordPress themes usually have updates coming in. Some of the themes have very frequent updates. When ever you are updating a parent theme, the customization done on the theme are lost. This happens because during the process of updating the theme, It over writes the current theme files.
By Adding WordPress child theme, the customized files are present in the child theme, thus on upgrade, these files are not affected.