Skip to main content

What Is A Child Theme

"A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme." – WordPress Codex Before unpacking what a child theme is, it’s important to understand what a parent theme is and also the relationship between the two entities.

Parent theme

Intricately developed by either an agency, company or individual, a parent theme comes fully packaged with all of the relevant code files and WordPress-ready functionality required for building a website. Any theme that you purchase via a theme marketplace such as Envato Market, or from a vendor such as Elegant Themes, would be deemed as a parent theme. If you’re a Divi user, then Divi itself will be the parent theme.

Child theme

A child theme is a separate entity to the parent theme that can be created or purchased via third-party developers.

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.