ZeroToWP

Child Theme

Quick Definition

A child theme inherits all the functionality and styling of a parent theme but lets you make customizations that won't be lost when the parent theme updates. It's the safe way to modify a theme.

WordPress theme directory — child themes build on top of existing parent themes

What Is a Child Theme?

A child theme is a theme that inherits everything from another theme (the "parent") while letting you customize it safely. According to the WordPress Theme Handbook, "a child theme includes everything from its parent theme by default" and can be "used to make customizations without directly modifying the parent theme's files."

Why not just edit the parent theme directly? Because theme updates overwrite your changes. If you modify Astra's header.php and Astra releases an update, your modification is gone. A child theme keeps your changes in a separate folder that the parent update never touches.

How the inheritance works:

  1. WordPress loads the child theme
  2. For any file the child theme doesn't have, WordPress falls back to the parent
  3. If the child theme has its own version of a file, it overrides the parent's version

Child Themes in Practice

A child theme requires just one file: style.css with a special header:

/*
Theme Name: My Custom Astra Child
Template: astra
*/

The Template: line must exactly match the parent theme's folder name.

To create a child theme:

  1. Create a new folder in wp-content/themes/
  2. Add style.css with the required header
  3. Optionally add functions.php for custom PHP code
  4. Activate via Appearance → Themes

What you can customize:

  • CSS styles — add or override the parent's styling
  • Template files — copy any template from the parent, modify it in the child
  • Functions — add new features via functions.php
  • Block patterns and templates — override the parent's block-based design elements

Why It Matters

Child themes are the professional way to customize WordPress. They keep your changes update-safe, organized, and reversible. See our best themes guide and theme selection guide.

Related Terms

Related Articles