Child themes are very useful and might come in handy, because if anyone want to edit it, it will not affecting the core files of the parent theme. It is also perfect for when a developer makes an update to the parent theme, because you will not lose your previous work / modifications.
So how can you do it?
First of all, create a directory named “YourThemeName-child” and place it in the same location where the parent theme is placed. Example: if your theme name is Kreativo, then you should name your child theme Kreativo-child. Please note that the title is case sensitive.
And next?
Once you have created the folder you need to keep in mind that the basic structure of your child wordpress theme, should consist in 2 files.
1.A screenshot of your theme (.JPG or .PNG) with size 600 x 450, with the name screenshot.png / screenshot.jpg
2.A .css file named style.css, in which you should add the following lines
Theme Name: NameOfTheme
Theme URI: http://example.com/themename
Author: Your Name / Corporation
Author URI: http://example.com
Template: YourTheme
Version: 1.0.0
Tags: light, dark, two-columns, etc.
Text Domain: your-text-domain
*/
@import url(“../YourTheme/style.css”);
/* =After this line you can customize the new CSS
————————————————————– */
[/css]
The important thing here is to never forget to add this line:
[css] Template: YourTheme[/css]
which represents the exact name of the folder where the parent theme is placed in.
If you want to change/modify other files from the parent theme, copy that file inside the child theme, and keep the same directory/file structure. Example: If you copy a file from the folder “yourtheme/admin/file.php” you should copy the file inside the child theme in the same folder “yourchildtheme/admin/file.php”
That’s all!
Enjoy creating child themes.