March 24, 2016 at 1:33 pm #2373
Child themes are a great WordPress feature, that should be used by everyone. If you wish to make any modifications to the themes code files – edit styling, add new functions etc. then you must always use a child theme. The reason for this is simple – when you edit code files using a child theme, you can still update the parent theme to the latest version when an update is released. Otherwise you would lose your modifications every time you make an update.
Your child theme will include all of the features and functions of the parent theme. Nothing will change apart from the fact that you can now make changes with ease.
How to activate a child theme
Every Planetshine theme comes with a child theme template included. Open the folder you downloaded from Themeforest and inside it you’ll find a zip with the word “child” in it. For example “polaris-child.zip” or “goliath-child.zip”.
Take this zip, upload it to your WordPress just like you would any other theme and activate it. Make sure you have installed the parent theme on the same WordPress or otherwise none of this will work.
Now you have a working child theme, that you can use modify parent theme files.
Editing the CSS code of parent theme
In some cases you might want to make modifications in theme’s styles that are not possible with the Visual Editor alone. In these cases you need to write CSS code. For small changes we recommend that you either use the Custom CSS box that can be found in theme settings or use SiteOrigin CSS plugin.
If however you need to do a lot of changes, it’s best to you a separate file for this. All child themes code with style.css file that you can use for this purpose. The theme will include this file after all the main CSS files, so you should have no problem overriding the default styling.
Overriding theme template files
If you wish to make changes to one of the theme template files you can simply copy it from the main theme into the child theme. WordPress will recognize this and use the version found inside the child theme. For example, if you want to change something in the footer, then copy the file footer.php from parent theme into the child theme. Then make your modifications.
Only files that are inside the main theme folder ( the first level where files like header.php and footer.php are located) and files inside /theme/templates/ folder can be overridden like this. When overriding files from /theme/templates/ make sure that you create the same folder structure inside you child theme – create folder “theme” and inside that place folder “templates“.