How to Create a Child Theme in WordPress Easily 2025
How to Create a Child Theme in WordPress Easily 2025

How to Create a Child Theme in WordPress (Classic and Block Themes)

Create a child theme in WordPress for classic or block themes: the style.css header, loading styles, theme.json, template overrides and fixes for common problems.

A child theme lets you change a WordPress theme without editing its files directly. It inherits everything from its parent theme, and you only add what you want to change. When the parent theme updates, your changes stay in place.

This guide shows how to create a child theme in WordPress in 2026, for both classic themes and block themes, and how to fix the most common problems.

The Short Answer

To create a child theme in WordPress:

  1. Back up your site and note the parent theme’s folder name.
  2. Create a new folder in wp-content/themes/, for example twentytwentyfive-child.
  3. Add a style.css file with a Theme Name and a Template line naming the parent folder.
  4. For a classic theme, add a functions.php file that loads the parent’s stylesheet. For a block theme, add a theme.json file for your style changes.
  5. Activate the child theme under Appearance → Themes.

If you would rather not touch files, the free Create Block Theme plugin can create a child of the active block theme from the dashboard.

Do You Need a Child Theme?

You need one if you plan to change theme files: templates, PHP functions, or CSS that you don’t want to lose in the next update. You probably don’t need one if:

  • You only change colors, fonts, and layouts in the Site Editor or Customizer. Those settings are saved in the database, not in theme files.
  • You only add a few lines of CSS. Appearance → Editor → Styles → Additional CSS (or the Customizer’s Additional CSS for classic themes) is enough.
  • You want to add site features such as custom post types. Those belong in a plugin, so they keep working if you change themes.

Our comparison of block themes vs classic themes explains how each type stores your changes.

Before You Start

  • Back up the site. See how to back up a WordPress site.
  • Use a test copy if you can. A staging site or WordPress Playground lets you experiment safely.
  • Find the parent folder name. Look in wp-content/themes/. The folder name, not the display name, goes in the Template line. For Twenty Twenty-Five it is twentytwentyfive.
  • Get file access through SFTP or your host’s file manager.

Creating a Child Theme for a Classic Theme

Step 1: Create the folder and style.css

Create wp-content/themes/generatepress-child/ (use your own parent’s name) and add a style.css file:

/*
 Theme Name:   GeneratePress Child
 Template:     generatepress
 Description:  Child theme for GeneratePress
 Version:      1.0.0
 Text Domain:  generatepress-child
*/

Theme Name and Template are the important lines. If Template doesn’t exactly match the parent’s folder name, WordPress reports the theme as broken. The WordPress Theme Handbook lists the other header fields.

Step 2: Load the stylesheets in functions.php

Create functions.php in the same folder. This example loads the parent stylesheet, then your child stylesheet:

<?php
add_action( 'wp_enqueue_scripts', function () {
    wp_enqueue_style(
        'parent-style',
        get_template_directory_uri() . 'https://cdn.jackober.com/style.css?icv=7.26.00'
    );
    wp_enqueue_style(
        'child-style',
        get_stylesheet_uri(),
        array( 'parent-style' ),
        wp_get_theme()->get( 'Version' )
    );
} );

Some parent themes already load their own stylesheet, and some also load the child’s. If you see styles loading twice in your browser’s developer tools, remove the matching line. Check the parent theme’s documentation if you are unsure.

Step 3: Activate and test

Go to Appearance → Themes, activate the child theme, and check a few pages. Menus, widgets, and Customizer settings are stored per theme, so you may need to set some of them again.

Creating a Child Theme for a Block Theme

Block themes work differently. Most styling lives in theme.json, and templates are HTML files made of blocks.

Step 1: Create the folder and style.css

Create wp-content/themes/twentytwentyfive-child/ with a style.css that contains the same header block, with Template: twentytwentyfive. You don’t need functions.php just to load the parent’s styles.

Step 2: Add theme.json

Add a theme.json file with only the settings you want to change. WordPress merges it with the parent’s theme.json:

{
  "$schema": "https://schemas.wp.org/trunk/theme.json",
  "version": 3,
  "styles": {
    "color": {
      "background": "#fdfcf8"
    },
    "typography": {
      "lineHeight": "1.7"
    }
  }
}

Be careful with lists such as color palettes and font sizes. A palette in the child usually replaces the parent’s palette rather than adding to it. Our theme.json guide explains the file in detail, and Learn WordPress has a lesson on creating a basic child theme for block themes.

Step 3: Override templates if needed

To change a template, copy it from the parent’s templates/ or parts/ folder into the same folder in your child theme, then edit it. Changes you make in the Site Editor are saved in the database. You can export them into the child theme’s files with the Create Block Theme plugin.

How Child Themes Override the Parent

What you add to the childWhat happens
A template file with the same name, such as single.phpThe child’s file is used instead of the parent’s
functions.phpLoaded in addition to the parent’s, before it
theme.jsonMerged with the parent’s settings
style.cssHolds the theme header; styles load only if they are enqueued (classic) or added via theme.json/enqueued CSS (block)
New files such as templates/page-landing.htmlAdded as extra templates

Because the child’s functions.php loads first, you can’t override a parent function just by declaring one with the same name. That only works for “pluggable” functions that the parent wraps in function_exists(). Otherwise, use the hooks and filters the parent theme provides.

Common Problems and Fixes

  • The theme shows as broken. The Template value doesn’t match the parent’s folder name, or the parent theme isn’t installed.
  • The site has no styling. The parent stylesheet isn’t loaded. Check the functions.php code above.
  • Your CSS doesn’t apply. The parent’s selectors are more specific, or your stylesheet loads first. Load the child style after the parent, as in the example.
  • A white screen after editing functions.php. A PHP syntax error. Rename the child theme folder through SFTP to switch back, then fix the code. Our white screen of death guide explains more.
  • Site Editor changes don’t appear in the files. They are stored in the database until you export them.

Common Mistakes

  • Editing the parent theme directly. The next update erases your changes.
  • Copying the whole parent theme into the child. Copy only the files you change, or you won’t get the parent’s fixes.
  • Putting site features in the theme. Custom post types and shortcodes belong in a plugin.
  • Skipping the backup. One typo in functions.php can take the site down.

FAQ

Do child themes slow down WordPress?

Not noticeably. A child theme adds a few small files. Loading the same stylesheet twice can add a request, so check that the parent’s styles load only once.

Will I lose my changes when the parent theme updates?

No. That is the main reason to use a child theme. Your files in the child folder are not touched by parent updates.

Can I make a child theme of a child theme?

No. WordPress supports only one level: a parent theme and its child.

Do I need a child theme to add custom CSS?

No. For small CSS changes, use Additional CSS in the Site Editor or Customizer. Use a child theme when you have a lot of CSS or need to change templates and PHP.

Can I create a child theme without code?

Yes, for block themes. The Create Block Theme plugin can create a child of the active theme from the dashboard.

The Bottom Line

A child theme is the safe way to change theme files in WordPress. For a classic theme, you need a style.css with the right Template line and a functions.php that loads the styles. For a block theme, style.css plus a small theme.json is often enough. Copy only the files you change, keep a backup, and your changes will survive every parent theme update. If you are still choosing a theme, see our picks of free WordPress themes for blogs.

Sources & Further Reading

Articles are editorially reviewed by Jackober and factual claims are checked against cited sources.

1 comment
Leave a Reply

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

You May Also Like