This article was last updated on the April 28, 2018.
Setup a child theme
Child Themes: Your New Best Friend
A child theme is a theme that inherits the functionality of another theme, called the parent theme. Child themes allow you to modify, or add to the functionality of that parent theme instead of modifying the core theme files directly. The problem with modifying core theme files is that your changes are in danger of being overwritten if and when you update the theme to the latest version down the road. This is obviously an undesirable outcome, especially if you've made dozens of adjustments throughout the theme. Ultimately, child themes are great for a few different reasons:
- If you modify an existing theme and it is updated, your changes will be lost. With a child theme, you can update the parent theme (which might be important for security or functionality) and still keep your changes.
- It can speed up development time.
- It’s a great way to get started if you are just learning WordPress theme development.
Setting up a child theme actually takes a little bit of work as you need to create a new directory for the child theme, specify the parent theme so WordPress knows where to apply the new changes, enqueue the parent theme's main CSS file, et cetera. You might also want to set up a functions.php file for various pieces of functionality that you want to add or modify. Fortunately, we've done all the heavy lifting for you in this area and all you need to do is use our provided child theme, which requires none of the setup listed above.
Provided Child Theme
We provide a ready-made child theme for you to use. Download it here.
Let's get started on installing our child theme, head to the main dashboard area as mentioned above, scroll down and you should see the child theme option like this:
Go ahead and click on that, which should present you with a screen like this:
You'll see there are two child themes, one which is for Pro and one which is for X, make sure you download the correct child theme for your product.
Once you've clicked on "Download Child Theme", you should have a prompt to either open or save the file like this:
We want to save it, so we can upload the compressed zip later to our WordPress site, so go ahead and check saved and then click "ok"
Note: Exactly how the prompt shows will depend on your computers operating system, but it should be self-explanatory.
Installing The Child Theme
Now you have the child theme downloaded it's time to install it, go ahead and open up your WordPress dashboard/admin, i.e (yourdomain.com/wp-admin) and login. On the right-hand side click on "Appearance", you should now have a screen like this:
As you can see in the screenshot above, there's a couple of "Add new theme" buttons, click either one. You should have a screen like this now:
Click on "Upload theme", then click on "browse":
Find the child theme you downloaded in the earlier steps and select that to upload, then go ahead and click on "Install Now":
The theme will now install, once it's installed, go ahead and click on "activate":
Congrats! You've now successfully downloaded, installed and activated your child theme, you can now safely make edits without fear of losing your modifications on a parent theme update.