What is a Child Theme in WordPress? (And Do You Still Need One)

A child theme in WordPress is a theme that inherits the design and functionality of another theme, called the parent theme. You use a child theme when you want to customize a theme’s code without losing those changes the next time the parent theme updates.

That’s the short answer. The longer answer is that child themes have become less necessary since WordPress introduced block themes and full site editing. In this post I’ll walk through when you actually need one, when you can skip it, and how to create one properly for both classic and block themes.

Do you actually need a child theme in 2026?

For years the answer was “always use a child theme”. That advice made sense when every customization meant editing functions.php, header.php, or style.css directly. Update the parent theme and your edits were gone.

Things have changed. If you’re using a block theme (Twenty Twenty-Four, Twenty Twenty-Five, Kadence Blocks-based themes, etc.), most of what people used to need a child theme for now lives in the Site Editor, theme.json, and style variations. Colors, typography, spacing, layout, custom templates, template parts, global styles, all editable without touching theme files.

Here’s the simplest way to decide:

  • Block theme + only visual tweaks? Use the Site Editor and style variations. Skip the child theme.
  • Classic theme + any customization? Use a child theme.
  • Any theme + custom PHP hooks or functions? Use a child theme, or a code snippets plugin (more on that below).
  • Heavily modifying templates or theme.json? Use a child theme either way so your changes survive updates.

When a child theme is still the right call

There are still plenty of cases where a child theme is the cleanest option:

  • You need to add custom PHP functions tied to the theme (not plugin territory)
  • You want to override specific template files (like single.php or a block template)
  • You’re customizing a premium theme that gets frequent updates
  • You need a custom theme.json that extends or overrides the parent
  • You’re building something for a client and want the customizations portable

A child theme keeps your changes in their own folder. Update the parent theme as often as you want, your child theme is untouched.

How to create a child theme (classic theme)

For a classic (non-block) theme, you need two files: style.css and functions.php. Here’s the setup.

1. Create the folder

Inside wp-content/themes/, create a new folder. Name it something clear and lowercase, usually the parent theme name plus -child:

wp-content/themes/twentytwentyfour-child/
WordPress child theme folder inside wp-content/themes viewed through FTP

2. Add style.css

Inside that folder, create style.css. The header comment is what makes WordPress recognize it as a child theme. The Template: value must exactly match the folder name of the parent theme:

/*
Theme Name:   Twenty Twenty-Four Child
Template:     twentytwentyfour
Version:      1.0.0
Description:  Child theme for Twenty Twenty-Four.
Author:       Your Name
*/
Child theme style.css file showing the required header comment with Theme Name and Template fields

The only required fields are Theme Name and Template. Everything else is optional but worth filling in.

3. Add functions.php and enqueue the parent stylesheet

This is the step a lot of guides get wrong or skip. If you don’t enqueue the parent stylesheet, your site loads with no styles.

Create functions.php in the same folder with this:

<?php
add_action( 'wp_enqueue_scripts', 'my_child_theme_styles' );
function my_child_theme_styles() {
    wp_enqueue_style(
        'parent-style',
        get_template_directory_uri() . '/style.css'
    );
    wp_enqueue_style(
        'child-style',
        get_stylesheet_uri(),
        array( 'parent-style' )
    );
}

This loads the parent styles first, then the child’s style.css on top so your overrides win.

4. Activate the child theme

In WP admin go to Appearance → Themes. Your child theme should be listed. Click Activate. If you want a preview image in the themes list, drop a screenshot.png into the child theme folder (see the correct size and format here).

WordPress admin Appearance menu with Themes option highlighted

How to create a child theme (block theme)

Block themes work a little differently. You still need style.css with the header, but the enqueue step is usually unnecessary because block themes load styles through theme.json and the block system.

Minimum setup for a block theme child:

  1. Create the folder (e.g. twentytwentyfour-child)
  2. Add style.css with the same header as above
  3. Optionally add theme.json to override global styles
  4. Optionally add functions.php if you need custom PHP
  5. Activate

The fastest way to generate a block theme child is the official Create Block Theme plugin from WordPress.org. Install it, activate your parent theme, then use the plugin to generate a child theme in one click. It handles the folder, style.css header, and theme.json scaffolding for you.

Common child theme mistakes

These are the ones I see most often:

  • Wrong Template value. It must match the parent theme’s folder name exactly, case-sensitive. If your parent folder is kadence, your child’s Template line is Template: kadence, not Kadence or the theme’s display name.
  • Copying functions.php from the parent. Don’t. A child theme’s functions.php runs in addition to the parent’s, not instead of. Copying it will cause fatal errors from duplicate function names.
  • Forgetting to enqueue parent styles (classic themes). Site loads unstyled. See step 3 above.
  • Using @import in style.css. It works but slows page load. Always enqueue instead.
  • Renaming the parent theme folder later. Breaks the child theme immediately. The Template value is a hard dependency.
  • Heavy customizations that should be a plugin. Anything site-wide that should survive a theme change (custom post types, shortcodes, integrations) belongs in a plugin, not a child theme.

Alternatives to a child theme

If all you need is one of these, you probably don’t need a child theme at all:

  • A few CSS tweaks. Use Appearance → Customize → Additional CSS, or the Global Styles panel in the Site Editor for block themes.
  • A single code snippet or filter. Install a code snippets plugin like Code Snippets. Snippets survive theme updates and are faster to add than building a child theme. I wrote up 10 useful snippets here.
  • Global color or font changes on a block theme. Use style variations or edit Global Styles directly in the Site Editor.
  • Custom post types, shortcodes, or anything site-wide. Build a plugin (or use an existing one). Those don’t belong in a theme at all.

Bottom line

A child theme is still one of the safest ways to customize a WordPress theme, but it’s no longer the default answer. On a modern block theme, the Site Editor and theme.json handle most of what child themes used to be for. Reach for a child theme when you need custom PHP, template overrides, or heavy theme.json changes that you want protected from parent theme updates. Reach for a code snippets plugin, Additional CSS, or Global Styles when you don’t.

Once you’ve got it set up, activate it like any other theme. If you ever want to roll back, WordPress makes it easy to delete a theme cleanly from the admin.

Picture of Andy Feliciotti

Andy Feliciotti

Andy has been a full time WordPress developer for over 10 years. Through his years of experience has built 100s of sites and learned plenty of tricks along the way. Found this article helpful? Buy Me A Coffee

3 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Tips Monthly
Get the latest from SmartWP to your inbox.