8 min read

How to Create a Child Theme in WordPress

Shashank Dubey
Content & Marketing, Wbcom Designs · Published Dec 14, 2021 · Updated Nov 6, 2026

Last updated: 6 November 2026

If you build on top of an existing theme, a child theme is the safe way to customize it. This article shows how to create a child theme in WordPress, step by step, for both classic themes and block themes.

The problem is updates. If you edit files inside a theme’s folder (anything under /wp-content/themes/yourthemename/), the next theme update can overwrite your changes. A child theme gives you a separate folder where you keep your own copies of the files you want to change, so a parent theme update never touches your work.

This is standard practice, not a workaround. Whole markets exist for child themes of popular frameworks such as Genesis, and the WordPress developer handbook documents the approach in its child themes chapter.

Quick answer

To create a WordPress child theme, make a new folder in /wp-content/themes/, add a style.css file whose header contains a Template line matching the parent theme’s folder name, load the parent stylesheet with wp_enqueue_scripts in a functions.php file, then activate the child under Appearance > Themes. Block themes can skip the stylesheet step because styling comes from theme.json.

WordPress powers 39.5% of all websites according to W3Techs (6 November 2026), so the odds are high that you will customize a theme that someone else maintains. That is the exact case a child theme is built for.

Creating Your Own Child Theme

The minimum is one folder and one file. In practice you will add a second file, functions.php, to load the parent theme’s styles properly.

You need access to your site through SFTP or your host’s file manager. An SFTP client such as FileZilla makes it easier to add and edit files and folders. If you have a local development copy of the site, working there is safer still.

1. Creating Your Child Theme’s Folder

Log in with your client and go to /wp-content/themes/. Each folder in there is an installed theme.

Create a new folder. The name is up to you, but a descriptive pattern such as parenttheme-child keeps things clear (where parenttheme is the folder name of your active theme).

Here’s an example:

Child Themes

In this example the active theme is Twenty Eleven, so the child folder is called twentyeleven-child. The screenshot is from an older WordPress admin, but the folder structure is unchanged.

2. Creating Your Child Theme’s style.css File

The only file a child theme strictly needs is style.css. WordPress reads the comment block at the top of it to recognize the theme, so open a text editor and paste this into a blank file:

/*
Theme Name: My Child Theme
Theme URI: https://example.com/
Description: A child theme of Parent Theme with my own customizations.
Author: Your Name
Author URI: https://example.com/
Template: parenttheme
Version: 1.0.0
*/

Most of this is generic and you can change it freely. The one line you must get right is Template. It tells WordPress which theme is the parent, and per the developer handbook its value must be a 100% match of the parent theme’s folder name, relative to the wp-content/themes folder. The folder name, not the display name, is what counts.

If you plan to publish the theme in the WordPress.org directory, the main stylesheet documentation lists more required header fields, including Requires at least, Tested up to, Requires PHP, License and Text Domain. For a private child theme on your own site, Theme Name and Template are enough.

3. Loading the Parent Theme’s Styles

A child theme’s own style.css is not loaded automatically in a way that pulls in the parent’s CSS. If you activate the child now, you may see an unstyled site. Do not fix that with an @import line inside style.css. That method makes the browser download stylesheets one after another, which slows the page, and the handbook teaches enqueueing instead.

Create a file named functions.php in the child folder and add this:

<?php
add_action( 'wp_enqueue_scripts', 'my_child_enqueue_styles' );
function my_child_enqueue_styles() {
	wp_enqueue_style(
		'parent-style',
		get_parent_theme_file_uri( 'style.css' )
	);
	wp_enqueue_style(
		'child-style',
		get_stylesheet_uri(),
		array( 'parent-style' ),
		wp_get_theme()->get( 'Version' )
	);
}

The first call loads the parent’s style.css through get_parent_theme_file_uri(). The second loads the child’s style.css and lists the parent as a dependency, so the child’s rules come last and win any conflicts. Using the child’s version number also helps browsers pick up changes after you edit the file.

One caution from the handbook: if the parent theme already loads the child’s stylesheet itself, the child does not need to do anything. Check the parent’s documentation if you see styles loading twice.

4. Activating Your Child Theme

Go to Appearance > Themes in the WordPress admin. The parent is shown as active, and your child theme appears in the list with the name and author you put in the header:

Child Themes

Click “Activate” and the child theme goes live:

Child Themes

You will not see any visual change yet, because you have not changed anything. From here on, every rule you add to the child’s style.css takes effect, and a future update to the parent theme does not overwrite it.

5. Making Further Alterations and Additions

Changing CSS is the easy part. What about the parent theme’s PHP templates?

The answer is the same pattern. Copy the template file from the parent into the child theme’s folder and edit the copy. WordPress looks in the child first and uses its version when one exists. The same works for new files, such as custom page templates: add them to the child folder and they are picked up.

Keep the directory structure identical to the parent. A file at /parenttheme/includes/example.php must live at /parenttheme-child/includes/example.php to override it.

The functions.php file behaves differently from templates. It does not replace the parent’s file. Both load, with the child’s running immediately before the parent’s. So never copy the parent’s whole functions.php into the child. Add only your own functions, otherwise you risk a fatal “cannot redeclare function” error. When you include your own PHP files, use get_theme_file_path() and get_theme_file_uri() so paths resolve from the child theme first.

Child Themes for Block Themes

If your parent is a block theme (such as Twenty Twenty-Five), the steps are shorter. The folder and the style.css header with the Template line work the same way, but block themes handle most styling through theme.json, so the stylesheet-loading step is generally not needed.

A child can add its own theme.json with only the settings and styles you want to change, and it can overwrite any template, template part or pattern from the parent by adding a file with the same name. For patterns, the registered Slug must also match. Many changes that once needed code can now be made in the Site Editor, but those edits are stored in the database, not in files, and the handbook notes there is no standard way to package them as an installable theme.

TaskClassic parent themeBlock parent theme
Required filestyle.css with Template headerstyle.css with Template header
Load parent CSSwp_enqueue_style in functions.phpUsually not needed; theme.json handles styles
Change colors, fonts, spacingCSS in the child style.cssChild theme.json or Site Editor
Change a layoutCopy the PHP template into the childAdd a template or template part with the same name
Add PHP functionsChild functions.php (loads before the parent’s)Child functions.php, if needed

Common Mistakes

Most problems come down to three things. The Template value does not match the parent’s folder name exactly, so the child shows up as broken in the Themes screen. The parent’s functions.php was copied wholesale into the child. Or the site was activated before the parent stylesheet was enqueued, which leaves the front end unstyled.

After activating, re-save your menus and widget areas if they look empty. Some classic themes store theme mods and menu locations per theme, so the child starts with its own settings. Check Appearance > Customize for the options your parent theme used.

Wrapping Up

BuddyX ThemeCreating a child theme is quick, and it removes the risk of losing customizations when the parent updates. Spend the few minutes on it before you touch any theme code, even for a small tweak. If you are still choosing a theme to build on, our roundup of WordPress themes for tech startups and the list of free and premium university WordPress themes are good places to compare options. If your changes involve site errors along the way, see how to fix common WordPress errors.

Frequently asked questions

What is a child theme in WordPress?

A child theme is a theme that inherits the design and features of another theme, called the parent. It holds only your changes, so the parent can be updated without wiping them out.

Do I need a functions.php file in a child theme?

Only style.css is strictly required. In a classic theme you will almost always add functions.php to enqueue the parent stylesheet. It also loads alongside the parent’s functions.php instead of replacing it.

Should I use @import or wp_enqueue_style to load the parent CSS?

Use wp_enqueue_style on the wp_enqueue_scripts hook. The developer handbook teaches enqueueing, and @import forces browsers to fetch the stylesheets in sequence, which is slower.

What does the Template line in a child theme’s style.css do?

It names the parent theme. The value must exactly match the parent’s folder name inside wp-content/themes, not its display name. If it does not match, WordPress cannot find the parent and the child will not work.

Can I make a child theme of a block theme?

Yes. Use the same folder and style.css header, then add a theme.json with your overrides and any templates, template parts or patterns you want to replace. You usually do not need to enqueue a stylesheet.

Will my customizations survive a parent theme update?

Files in the child theme folder do. Changes made in the parent theme’s own folder do not, and neither do files you edited in place. That is the whole reason to use a child theme.

Shashank Dubey
Content & Marketing, Wbcom Designs

Shashank Dubey, a contributor of Wbcom Designs is a blogger and a digital marketer. He writes articles associated with different niches such as WordPress, SEO, Marketing, CMS, Web Design, and Development, and many more.

Related reading