While many themes provide us with a wide array of options and design choices, not everything is customizable directly from the CMS without touching the underlying code. This is why every project uses a child theme as an addon to the original parent theme. By using a child theme, we can add additional code or alter/replace existing files in the parent theme without exposing the actual parent theme. In short, child themes inherit the features of a theme’s core, including full compatibility with all plugins. They adapt different styles and appearances, because child themes can make a parent theme look completely different. This is great for two main reasons.
Note: This does not guarantee every update is compatible. Occasionally, a theme update alters the code, or removes/deprecates functions that are used by the child theme. It is always recommended testing out a theme update in a staging environment first. Locally, update the theme by overwriting the current theme folder with the updated version, and see if it produces any errors or compatibility issues.''
For some theme-registered functionalities or hardcoded designs, touching the code of the parent theme is required to achieve the wishes from client/design. Since these changes are removed upon the next theme update (it overwrites the file), editing the parent theme is not recommended and should only be done as an exception. The workflow is only to add or edit files from within the child theme. To counteract the code-removal upon updating, patch files are created for all changes within the parent theme. These can be found in the /_resources/patches folder
.
Last modified | Thursday, January 28, 2021, 3:10:42 PM UTC |
Last author | Glenn de Haan |
Commit ID | 0e617f4 |