WordPress Child Themes: How to Make and Use One

WordPress Child Themes: How to Make and Use One

A child theme is a small theme that inherits everything from another one, its parent, and contains only your changes. When the parent is updated, your changes stay where they are.

It is the difference between drawing on a wall and on a sheet of tracing paper placed over it.

Do you need one?

For years the answer was always yes. Today it depends on what you want to change.

You want toChild theme?
Change colors, fonts, spacingNo: theme settings or Styles
Add a little CSSNo: Additional CSS
Change the header, footer or a template in a block themeNo: the site editor saves it in the database
Edit PHP templates of a classic themeYes
Add functions in PHPA snippets plugin, or yes
Keep your changes in Git and move them between sitesYes
Deliver a design to a clientYes

If you only need a function, a plugin such as WPCode is safer, and it survives a change of theme.

What is in a child theme

Two files are enough:

wp-content/themes/
  twentytwentyone/          (parent)
  twentytwentyone-child/    (child)
    style.css
    functions.php

The rest is optional. Any template you copy into the child, with the same name and path, replaces the parent's.

Create one by hand in five minutes

Step 1: the folder

Over SFTP or with the file manager of your hosting, create a folder inside wp-content/themes. The usual name is the parent's with -child at the end.

Step 2: style.css

/*
Theme Name:   Twenty Twenty-One Child
Template:     twentytwentyone
Version:      1.0.0
Text Domain:  twentytwentyone-child
*/

/* Your styles below */

Only Theme Name and Template are required. Template must be exactly the name of the parent's folder, with the same capital letters. It is the most common mistake.

Step 3: functions.php

<?php
add_action( 'wp_enqueue_scripts', function () {
  wp_enqueue_style(
    'child-style',
    get_stylesheet_uri(),
    array(),
    wp_get_theme()->get( 'Version' )
  );
}, 20 );

Is the parent's style sheet missing? It depends on how the parent loads it. Open your site: if it looks bare, add this line inside the function, before the other:

wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

Never use @import in style.css, as old tutorials do: it makes the page slower.

Step 4: activate it

Go to Appearance → Themes, activate the child and check the site. Menus and widgets sometimes have to be assigned again, since WordPress stores them per theme. Note down where they were before you activate it.

Optional: a screenshot.png of 1200 by 900 pixels, so you recognize it in the list.

Create one with a plugin

If you don't have SFTP, a plugin can do it. Check the dates first:

  • Child Theme Wizard: updated in June 2026, simple, well rated.
  • Generate Child Theme: updated in May 2026.
  • Child Theme Configurator is the best known, with 300,000 installs, but its last update was in June 2025. It is close to abandoned, so we would use the others.

Once the child exists, you can delete the plugin.

How inheritance works

FileWhat WordPress does
style.cssUses the child's. The parent's must be loaded as well
functions.phpLoads both, the child's first
Templates (single.php, header.php)Uses the child's if it exists
Parts called with get_template_part()Same
theme.jsonMerges the two, and the child's wins
templates/ and parts/ in block themesThe child's replaces the parent's

As the child's functions.php is loaded first, you can't redefine a parent's function unless it was written with function_exists(). To remove something the parent adds, wait until it has loaded:

add_action( 'after_setup_theme', function () {
  remove_action( 'wp_head', 'parent_function_name' );
}, 20 );

Two functions that get confused

  • get_template_directory_uri() is always the parent.
  • get_stylesheet_directory_uri() is the child if it is active.

For your own files, use the second one.

Common uses

Change one template. Copy single.php from the parent to the child and edit the copy. To know which to copy, see the template hierarchy.

A block theme. With style.css and a theme.json of a few lines you change the palette or the widths:

{
  "version": 3,
  "settings": {
    "layout": { "contentSize": "720px", "wideSize": "1200px" }
  }
}

WooCommerce. Copy the template from woocommerce/templates to a woocommerce folder in the child. Review them after each big update: WooCommerce → Status lists the outdated ones.

Add code to the header. With the wp_head hook; here are more ways.

Looking after a child theme

  1. Copy as little as possible. Each copied template stops receiving the parent's fixes.
  2. Comment what you changed and why.
  3. Keep it in Git, or at least in your backups.
  4. After each update of the parent, compare your copies with the originals.
  5. Don't put in it what belongs to the site. Content types, shortcodes and integrations go in a plugin, so you don't lose them when you change theme.
  6. Never make a child of a child. WordPress doesn't support it.

Try changes on a staging copy. An error in functions.php can leave the site blank; if it happens, rename the child's folder over SFTP and WordPress will fall back.

Common errors

  • "The parent theme is missing". The name in Template is wrong, or somebody deleted the parent. It must remain installed, though not active.
  • The styles don't change. Cache, or a stronger rule in the parent. Inspect the element with F12.
  • The site looks different on activating it. The settings of the customizer are per theme. Export and import them, or set them again.
  • A white screen. A missing semicolon, or a space before <?php.

If you prefer to hand it over, our development team takes on WordPress work like this, and the web design team the design.

Frequently asked questions

Does it slow down the site?

Not noticeably. It adds one small style sheet.

Can I make one for a site that already has changes in the parent?

Yes. Download the original theme, compare it with yours and copy only the differences to the child. Then update the parent.

And with a page builder?

Elementor, Divi and others keep the design in the database. The child theme is still useful for functions and for the occasional template.

Related Articles

How to Send Transactional Email from WordPress: SMTP Setup Guide WordPress

How to Send Transactional Email from WordPress: SMTP Setup Guide

Set up SMTP in WordPress to send transactional email reliably. This guide covers plugins, settings, and testing so your password resets and receipts always arrive.

Dec 1, 2026
WordPress Accessibility: EAA & WCAG 2.2 Checklist WordPress

WordPress Accessibility: EAA & WCAG 2.2 Checklist

WordPress accessibility checklist for the EAA and WCAG 2.2: fix contrast, keyboard, forms and checkout issues. Start auditing your site today.

Updated Dec 1, 2026
WooCommerce Black Friday Checklist for 2026 WordPress

WooCommerce Black Friday Checklist for 2026

WooCommerce Black Friday checklist: prep hosting, speed, checkout and security before the 2026 rush. Get your store sale-ready today.

Updated Dec 1, 2026