Tip:
Highlight text to annotate it
X
What is the advantage of using a WP child theme?
Just imagine, you need to adjust a theme for a client's web site. Maybe they want to change font sizes, colors and backgrounds.
To save time and money, you do these small adjustments in the source code of the original theme. Font sizes and colors can easily be changed in the style sheet, so you put the changes into the file style.css.
Maybe the client also want their own logo in the header, so you also make some changes in the file header.php, where the design for the header section is implemented.
Now, imagine that your client may recognize, that several months later, there is an update for their theme.
Updating WordPress themes is just a matter of two clicks with the mouse, so the client just do that.
After the update, you will get a call from a very distressed client of yours, because all the changes that you did half a year ago, are now gone.
This happens, because with every theme update, WordPress will overwrite all the files in the theme directory, including your modified style.css and header.php.
To prevent that, you build a child theme. The child theme stores all modified files in a different directory, so that they will not be overwritten by an update.
The connection to the original theme, also called the parent theme, is just done by a simple reference in the file style.css, so that your child theme will work as before, even after the parent theme is updated.
How you do that, will be shown in the next video.