In WordPress, one hears a lot about child themes. What are they, and why are they important?
The following is my understanding.
I mention in my post from June 18 the idea of a theme in WordPress. That said, what is a child theme?
Be advised, this is a practical explanation.
A child theme is a folder that lives outside the theme it’s based on, which we will call the parent theme. The child theme contains changes one has made to the parent theme. Assuming the child theme has been produced correctly, then selected as the active theme, WordPress knows to load its parent theme, then apply the tweaks that it finds in the child theme.
The child theme must include a stylesheet called style.css, which is a plain text file. Said style.css file must have a header that includes the lines Theme Name and Template, where its template is the parent theme.
How style.css in the child theme gets loaded depends on the parent theme. Apparently, some parent themes load the child theme’s style.css file automatically. With others, the child theme folder will need a functions.php file containing a custom function that will load its style.css
The reason a child theme is important is that themes commonly undergo updates, just like other software. Any customization done to the parent theme may be overwritten during an update. However, the update won’t overwrite the child theme.
Source: