The parent theme plays an important role like it acts as a base for the child.
Main Functions of parents and child themes? • Parent theme: Parents theme contains the code that creates the function & features of your wordpress site. • Child theme: Child theme contains the styles and image that form the base for your site’s design.
Features: • This parent/child framework protects the theme • In the earlier phase, if you customized a theme and now you want went to upgrade to a newer version you would need to get all your changes in the customized theme & then recreate them in the newer version, otherwise you would lose all your changes when you upgrade. • With the parent/child framework all customizations are stored in the child theme • Your customizations are safe from future upgrades because you have only upgrade the parent theme, which you never goes to edit, while the customizations are protected in your child theme which you don’t upgrade.
How to Use Parent and Child Themes? When you install a theme that uses a parent or child framework you upload both parent and child theme in same directory to /wp-content/themes/ but only activate the Child theme . For example: • When you install Thinkcode theme you upload the Thinkcode and Thinkcode-child folder to /wp-content/themes and then only activate the ‘Thinkcode-child’ theme.
Modifying Files from the Parent Theme Folder to Child Theme Folder • You should never edit files in Parent theme, only you can download a copy of the file which you want to modify onto your computer, make the necessary changes, and then upload it into your child theme folder. • Any files that are uploaded to the child theme automatically override in the parent theme as anything in the child takes first priority over the parent. • This technique can be used for folders within the parent theme, but you must re-create the as it is folder structure in your child theme that exists in the parent theme folder.