Many of us when download any theme, it consist of themes folder. One theme wit the name of child theme. Most of new developers of WordPress don’t know about this. This article covers all information about child theme for wordpress and what’s the purpose of it.
What is child theme for wordpress
Child theme is the branch of parent theme or main theme . When some one use premium themes or other free themes that are well developed they must include child theme. Child theme consist of few files but its main files are present in parent theme. Child theme for wordpress must contain ‘functions.php’ file. this file is most important file for child theme.
How to activate child theme for wordpress
When you install all themes files, then you have to go to activate the theme. Here you can activate the child theme only. Some people don’t activate the child theme they activate the parent theme, in this case the purpose of child theme goes away.
What the purpose of child theme and why it is important
The child theme plays very important role in theme itself. when anyone installs the themes file specially developers. They need to customize the theme according to its will. Because of this, we need to add some code or hooks in the theme file called ‘functions.php’. For example some one need to change or want to add new functionality in theme, they don’t need to go for specific file search and desired functionality that is off course in php. What a person do is that he can add hooks of that functionality. Like a woo-commerce a big WordPress plugin if you want t change the currency symbol in woo-commerce then yo don’t need to find the specific page file from where you can change. Because woo-commerce plugin has huge number of files. The good practice i that you can simply add the hook in ‘funcions.php’ file.
From here we can judge the importance of child theme for WordPress that if you made these changes in the parent file and in some case it has some syntax error or some other occur. Then, your theme will not load. But if same change you made in child theme function file then you can able to trace the errors or bugs. You can simple deactivate child theme and activate parent theme if errors or bugs not get fixed by removing your error in child theme ‘function.php’. Also you can add new child theme file. In this case your main theme file not get attacked with any change and your website is live. it can be very useful when there is large number of customization you have to do in your thee then what you can do is just write all your customize hooks in child theme.