All of our themes come with an alternative Child Theme. The following notes are to help you gain a better understanding about your Child Theme and how to use it.
(Please note: much of this article refers to our Karma WordPress theme however this information is identical for all of our WordPress Themes)
What is a Child Theme?
- A Child Theme is a “blank WordPress Theme” that pulls in all of it’s functionality from a parent theme.
When to use a Child Theme?
- A Child Theme comes in great handy when you plan to make significant hard-coded changes to your website. (ie. editing one of the theme’s PHP files)
- Using the Child Theme will ensure that you can upgrade your Parent Theme (ie Karma) and will not lose any of your custom code.
How to activate a Child Theme?
- To use a Child Theme, you will first need to install it’s parent theme. For example, if you are using our Karma theme you will first install and activate the regular Karma theme. You will then install and activate the Karma Child theme. Both files are located within your download package from ThemeForest. (Karma.zip and Karma-Child-Theme.zip)
- When a new version of the Parent Theme is released, you can upgrade the Parent Theme just as you normally would. You should never upgrade your Child Theme because you will lose all of your custom coding changes. The Child Theme is “as-is” and will never have a “new version” – this is because all of the core functionality is actually held within the Parent Theme.
Required Steps after activating a Child Theme:
- After a Child Theme has been activated there is only one additional step. The Menu ‘Theme Locations’ will need to be re-saved.
- From within your WordPress Dashboard click on ‘Appearance > Menus’. In the top-left corner of this page you will see a ‘Theme Locations’ box (screenshot below). Simply re-select your menus from the dropdown lists, save and rejoice.
How to edit a Child Theme?
- You edit your Child Theme just as you would normally edit any other WordPress theme. If editing via FTP, you will simply log into your server and locate the Child Theme on your web server. For example: wp-content/themes/Karma-Child-Theme/
- You should add all of your custom CSS code to “style.css” located within the Child Theme folder. You can use any of the default code from the Parent Theme and use it in the Child Theme with your custom changes.
- You can add any additional PHP functionality to “functions.php” located within the Child Theme folder. (be careful about editing this file. If you add invalid functions it will break your wordpress theme. No worries – you can always delete your invalid functions and the theme will work again as expected)