Child themes are great for adding custom changes to Superhero. However, they are generally used for customizing core code from the parent theme. This means that customizations of this nature fall outside our scope of support, and we won’t be able to help you with issues that you may encounter.


What Is A Child Theme?


The Superhero main download folder contains a child theme. Such a theme lets you apply custom code changes to your site. By using it, you will make sure that customizations won’t be overwritten, even after updating the parent theme.


Such a theme contains all the styling and functionality of the parent theme. Keep in mind that if you try modifying the code directly from the parent theme, then afterwards update it, you will lose the changes. You can use a child theme for other things as well, such as custom PHP functions and/or hooks, CSS applications and template file modifications. A child theme can be modified in more than one way. However, a child theme doesn’t guarantee than when updating the custom code on the parent theme you won’t have to perform further maintenance. This applies when you copy files from the parent theme to the child theme.


Downloading and Installing Superhero Child Theme


First, you must download and install the Superhero child theme. You will also download the Superhero’s Full Package from ThemeForest. Below you will find the detailed steps on how to download and install the Superhero child theme.


How To Download Superhero Child Theme


  1. Login to your ThemeForest account and go to Downloads tab.

  2. Go to your Superhero purchase, select Download. Choose the  “All Files & Documentation” option.

  3. After the download, find the .ZIP file on your computer and extract it. A folder called Superhero_Full_Package will appear.

  4. Go to Superhero_Full_Package > Superhero Theme. There you will see an file and an file.

  5. Install the file (the parent theme), and then install the child theme following the exact same process. Install the theme zip files via WP upload or via FTP upload.


 3 Methods Of Modifying A Child Theme


There are several ways to modify a child theme, but we will guide you through 3 of them. 


Method 1: Copy Files From Parent Theme


This is a common method of making customizations to the code, and also the easiest way. However, there are certain limitations to it. This is why we suggest that you only modify that files found inside the templates folder from the parent theme into the child theme. 


  • You can copy only some files to the child theme, because we’ve decided to not let core logical code (that can break the theme) be copied in the child theme. File in the folder included.

  • It is not always safe to update. When you make a major change to a file such as a header.php in the parent theme, you must copy the theme file from the parent theme and make the customizations again. We advise that you do this, or else the related feature might not work anymore.


Method 2: Pluggable Functions


These are PHP functions that can be changed inside a child theme or a plugin. You should know that if a function is wrapped inside a function_exists call in the parent theme, then you can create in the child theme the same function. It will overwrite the original function from the parent theme. You also have the option to copy the function in functions.php, in the child theme, and modify the output of page title bar contents from the child theme.


Method 3: Actions and Filters

This is the correct way to update or modify theme functions within a child theme in Superhero. In order to re-register within the child theme, you should use the after_setup_theme action from the functions.php in the child theme, remove the image size and simply re-register the image size. 


Useful Documentation On Child Themes


Lean more about child themes from the links below: