Fill in the parent theme folder name, give your child theme a name, and download a working child theme as a zip. It comes with a correct style.css header, a functions.php that loads the parent styles properly, and a README explaining what to do next.
- A child theme lets you customise a theme without losing those changes the next time the parent updates.
- Only two files are required:
style.csswith aTemplate:line naming the parent folder, andfunctions.phpto load the parent stylesheet. - The
Template:value must match the parent’s folder name exactly, not its display name. This is the single most common mistake. - Load parent styles with
wp_enqueue_style(), not@import, which blocks parallel downloads. - Block themes support child themes too, and can also override
theme.jsonand individual templates.
Why you want a child theme
Edit a theme directly and your changes survive exactly until that theme updates. Then they are gone, silently, usually noticed days later.
A child theme sidesteps that. It is a separate theme that inherits everything from its parent and overrides only the parts you change. The parent updates freely; your work sits in a folder the updater never touches.
It is worth being honest about when you do not need one, because a child theme is not free. If all you want is a few CSS tweaks, Appearance → Customize → Additional CSS survives updates on its own and is simpler to manage. Our guide to adding custom CSS in WordPress covers that route. Reach for a child theme when you need to override template files, add PHP, or change theme behaviour rather than appearance.
What the generator produces
The zip contains three files in a correctly named folder.
style.css
The header is what makes WordPress treat the folder as a child theme at all:
/*
Theme Name: My Child Theme
Template: twentytwentyfive
Version: 1.0.0
*/
Template is the important line. It must be the parent’s folder name, which is often not the name you see in the dashboard. The theme displayed as “Twenty Twenty-Five” lives in a folder called twentytwentyfive, and “Hello Elementor” lives in hello-elementor. Get this wrong and WordPress refuses to activate the theme, with an error about a missing parent.
functions.php
This loads the parent stylesheet and then yours, in that order:
function mychild_enqueue_styles() {
$parent_handle = 'twentytwentyfive-style';
$child_style = get_stylesheet_directory() . '/style.css';
wp_enqueue_style(
$parent_handle,
get_template_directory_uri() . '/style.css',
array(),
wp_get_theme( get_template() )->get( 'Version' )
);
wp_enqueue_style(
'mychild-style',
get_stylesheet_uri(),
array( $parent_handle ),
file_exists( $child_style ) ? filemtime( $child_style ) : '1.0.0'
);
}
add_action( 'wp_enqueue_scripts', 'mychild_enqueue_styles' );
Two details in there are worth understanding rather than copying blindly. The child stylesheet declares the parent handle as a dependency, which guarantees it loads second so your rules win without needing !important everywhere. And filemtime() uses the file’s modification time as the version number, so browsers pick up your edits immediately instead of serving a cached copy until you remember to bump a version string.
Why not @import
Older tutorials still use @import url("../parent/style.css") in style.css. It works, and it is slower: the browser has to download the child stylesheet, parse it, discover the import, and only then request the parent, one after the other instead of in parallel. The generator offers it for people maintaining older setups, but the enqueue method is the default for a reason.
Installing it
- Go to Appearance → Themes → Add New → Upload Theme and upload the zip. Or unzip it into
wp-content/themes/over SFTP. - Make sure the parent theme is still installed. Do not delete it. The child cannot work without it.
- Activate the child theme.
- Check the site. It should look identical, since you have not overridden anything yet. If it looks unstyled, the
Template:line does not match the parent folder name. - Add a
screenshot.pngat 1200×900 if you want a proper thumbnail in the dashboard. Our notes on WordPress theme screenshots cover the specifics.
Activating a child theme resets widget areas and some Customizer settings, because WordPress stores those per theme. Menus are usually reassignable in a couple of clicks, but do this on a quiet afternoon rather than a busy Friday.
Overriding parent files
To change a template, copy it from the parent into the child keeping the same relative path, then edit the copy. A file at parent/single.php becomes child/single.php. WordPress uses the child’s version automatically.
Block themes work the same way for files under templates/ and parts/, and a child can also ship its own theme.json whose values merge over the parent’s.
The one exception is functions.php. It does not replace the parent’s, it loads in addition to it, and it loads first. So copying the parent’s functions.php into your child is a reliable way to cause fatal “cannot redeclare function” errors. Only add new code there.
Frequently Asked Questions
How do I find the parent theme’s folder name?
Go to Appearance → Theme File Editor and the folder name appears in the file paths, or look in wp-content/themes/ over SFTP. It is lowercase with no spaces: “Twenty Twenty-Five” is twentytwentyfive, “Hello Elementor” is hello-elementor, “Astra” is astra. If you are working on someone else’s site, our theme detector reports the folder name directly.
My child theme activated but the site lost all its styling.
Nearly always the Template: line. It has to match the parent folder name exactly, including hyphens and lowercase. Open style.css and compare it against the actual folder in wp-content/themes/. The other possibility is that the parent theme was deleted, in which case reinstall it.
Do child themes work with block themes?
Yes. The mechanism is unchanged: style.css with a Template: line, and templates copied into the child to override them. Block themes add the ability to override theme.json, where your child’s values merge over the parent’s rather than replacing the file wholesale. Note that edits made through the Site Editor are saved to the database, not to files, so those already survive updates and do not need a child theme.
Do I need a child theme just for a bit of CSS?
Probably not. Additional CSS in the Customizer survives theme updates and needs no files at all. A child theme earns its place when you want to override templates, add PHP, or make changes substantial enough that you would rather keep them in version control.
More on the subject in our guide to WordPress child themes. Other tools: a wp-config.php generator and a plugin and theme detector.
Browse all our free WordPress tools, all free and none of them asking for an email address.