7. How a Child Theme Works

7. How a Child Theme Works

HOW A CHILD THEME WORKS

A child theme uses a series of various .php functions and WordPress optimized commands and hooks to call on the full functionality of the parent theme. This process is called enqueueing the parent theme. This basically means that the child inherits its functionality from the parent theme, and essentially “piggybacks” off of it.

When WordPress runs, it first looks to the files present in the child theme and executes the code it finds. If the files are not present in the child theme, it executes the commands found in the parent theme.

If you’ve created a header.php or footer.php file within a child theme, WordPress would execute the code found in the child theme. The only file that WordPress doesn’t prioritize child over parent for, is the functions.php file. In this regard, WordPress executes the code found in both files.

Although the child theme is given the space to take on a life of its own, it still only exists because of the parent theme, and only works if the relationship is set up correctly. This is why enqueueing the relevant functions must be done so with care.

https://divi.space/the-divi-css-and-child-theme-guide/

 


Child Theme Configurator Tutorial Videos

http://www.childthemeconfigurator.com/tutorial-videos/

 

*** End of Content ***

Last Update: 02/06/2020