child theme

A child theme is a WordPress theme that inherits the templates, functions and styling of another theme, called the parent theme, while allowing you to add or override specific parts. It lives in its own folder and contains at minimum a style.css file that references the parent. This lets you customise a site without altering the original code.

Also called: sub‑theme, subtheme

Why it matters

Using a child theme means you can change the look and behaviour of a website safely, because updates to the parent theme will not erase your customisations, protecting the client’s investment and avoiding costly rework.

How it works

When WordPress loads a theme it first checks for a child theme folder; if present, it reads the child’s style.css header for a “Template” line that points to the parent folder. The child’s functions.php runs after the parent’s, and the child’s stylesheet is enqueued, usually via wp_enqueue_style with the parent’s handle as a dependency, allowing overrides of templates and CSS.

The mistake people make

A common error is editing the parent theme directly, which means any future update will overwrite those changes and can break the site. Another frequent slip is not enqueuing the parent stylesheet, causing the child’s CSS to load without the base styles and resulting in a broken layout.

Related terms

parent theme, theme development, WordPress hooks

Illustration of a LibraFire team member on a video call with a client

How can we assist you?

Contact Us