
🧩 WordPress child theme: a complete guide to creating and customizing
You installed a theme, polished the site, adjusted colors and fonts, added a couple of custom templates. Then a theme update arrives and wipes everything out. Sound familiar?
A child theme in WordPress is the mechanism that separates your customizations from the developer's code. You change whatever you want, and the parent theme updates without consequences. It sounds like magic, but behind it is just one line in style.css.
In this guide, from concept to a working child theme: why you need one, how to create it manually, how to enqueue styles and functions.php, and what to do if something goes wrong. No fluff, with tested snippets.
💡 Quick overview:
- Create a child theme folder in
/wp-content/themes/, any name works, for examplemytheme-child - Add
style.csswith a theme header and aTemplate:line pointing to the parent theme's folder - Enqueue parent styles via
functions.php, using thewp_enqueue_style()function on thewp_enqueue_scriptshook - Copy any template file from the parent theme into the child theme and edit it without fear of updates
- Everything else (functions.php, custom fields, new templates) can be extended without touching the parent theme
What is a WordPress child theme
A child theme is a WordPress theme that inherits all functionality, styles, and templates from another theme. The one being inherited from is called the parent theme. A child theme by itself can consist of just a single style.css file and still work fully.

The inheritance mechanism is straightforward. When WordPress loads a page, it first looks for the required template file in the child theme. If found, it uses that file. If not found, it takes the file from the parent theme. This is why you can override only what you want to change, and everything else will automatically come from the parent theme.
The key element without which a child theme cannot exist is the Template: line in the style.css header. It points to the parent theme's folder name (for example, twentytwentyfour) and creates the parent-child relationship. The line must match the parent theme's folder name exactly, including letter case.
The parent theme can be ANY installed WordPress theme, from the default Twenty Twenty-Five to a commercial theme like Total or Kadence. The child theme "borrows" its files and functions but does not physically copy them.
Why you need a child theme: 4 reasons
You could skip all this and edit the parent theme directly. Many people do. But here is what happens next.
Safe updates
The parent theme developer releases an update, and you install it. If you edited the parent theme files directly, all changes are wiped out. A child theme stores your customizations separately: updating the parent does not touch them. You get both the fresh version of the theme (with security fixes) and your preserved customizations.
Isolated experimentation
Want to try a new template structure or an unconventional CSS hack? In a child theme you can experiment freely. If something goes wrong, deactivate the child theme and the site returns to the parent theme in its original state.
Clean codebase
A child theme contains only your changes. A couple of templates, functions.php with hooks, style.css with overrides. No mix of original code and your edits. When you need to fix something six months later, you are not digging through someone else's code looking for your own.
Quick development start
A child theme is the perfect sandbox for learning WordPress theme development. You do not write a theme from scratch (that takes hundreds of hours) but make targeted changes to an already working theme. The official WordPress child themes documentation recommends exactly this approach for beginning developers.
What are the downsides of child themes
There are disadvantages too. They are not critical, but knowing them in advance helps.
Basic coding knowledge required
Setting up a child theme involves HTML, CSS, and some PHP. If you have never opened a code editor, you will need to learn the basics. The good news: for typical tasks (enqueuing styles, adding a hook) the code is already written; you just copy it and substitute your own values.
Customizer settings migration
Some themes tie Customizer settings (colors, fonts, layout) to the active theme's name. When switching to a child theme, these settings "disappear." They are not lost; they remain in the database, tied to the parent theme's name. The solution: before activating the child theme, export the Customizer settings (many themes, such as Total, provide a built-in import/export tool), or transfer them manually after activation.
Dependency on the parent theme
A child theme without its parent is just a folder with files. If you decide to completely switch themes, you will need to create a new child theme from scratch. Functions embedded in the child theme's functions.php may be tied to hooks specific to a particular parent theme and will also need to be adapted.
How to create a child theme manually
The most direct path, without plugins, using only your hands. You will need access to your site's files (FTP, your hosting's file manager, or cPanel) and a text editor.
Step 1. Create the child theme folder
Open the WordPress themes directory: /wp-content/themes/. Create a new folder. Any name works, but the convention is to add the -child suffix to the parent theme's name: for example, for twentytwentyfive the child folder would be twentytwentyfive-child.
For working with files via FTP, FileZilla works well. Through hosting, use the built-in file manager in cPanel or your hosting panel.
Step 2. Create style.css with the theme header
In the child theme folder, create a file named style.css. This is the only required file. Paste in the theme header:
1 /* 2 Theme Name: Twenty Twenty-Five Child 3 Theme URI: https://example.com/ 4 Description: Child theme for Twenty Twenty-Five 5 Author: Your Name 6 Template: twentytwentyfive 7 Version: 1.0.0 8 */
The Template: line is the one that links the child theme to the parent. The value must EXACTLY match the parent theme's folder name. For Twenty Twenty-Five the folder is named twentytwentyfive, so that is exactly what you write. A typo or wrong letter case means the theme will not be recognized as a child theme.
Step 3. Enqueue the parent theme's styles
At this point the child theme already works; you can activate it in Appearance → Themes. But the site will appear without styles because your style.css is still empty (except for the header).
Create a file named functions.php in the child theme folder and add the code for enqueuing parent styles:
1 add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); 2 3 function my_theme_enqueue_styles() { 4 $theme = wp_get_theme( 'twentytwentyfive' ); 5 $version = $theme->get( 'Version' ); 6 7 wp_enqueue_style( 8 'parent-style', 9 get_template_directory_uri() . '/style.css', 10 array(), 11 $version 12 ); 13 }
This code dynamically picks up the parent theme's version and adds it as a parameter to the stylesheet URL. When the theme updates, the version changes, the browser clears its cache, and users see the current styles without CSS problems.
Replace
twentytwentyfivewith your parent theme's name. Usewp_get_theme()rather than a hard-coded version number; this protects you from cache issues on updates.

Step 4. Activate the child theme
In the WordPress admin: Appearance → Themes → find your newly created child theme → Activate. The site's appearance will not change; this is normal. You are on the child theme, and it works.
How to customize a child theme
The theme is activated; now for customization. Here is what you can and should do.
Adding your own styles
Write all your CSS rules IN THE style.css file of the child theme, after the header section. They will automatically override parent theme styles with the same specificity. If you want to change the heading color, write the rule in the child style.css, and it will apply.
Editing template files
Want to change the structure of single.php or footer.php? Copy the desired file from the parent theme into the child theme folder, preserving the same subfolder structure (for example, /template-parts/). Edit the copy in the child theme; when WordPress loads, it will use your version rather than the parent's original.
Important detail: you can copy only TEMPLATE FILES (those located in the theme's root folder and the template-parts/ folder). Files from subfolders like inc/, functions/, and classes/ are not copied this way. To modify logic from those files, use WordPress hooks and filters.
Extending via functions.php
The child theme's functions.php loads BEFORE the parent's. This means you can:
- Add new functions without touching the parent's
functions.php; - Override parent functions only if they are wrapped in
if ( ! function_exists() ); - Add new hooks and filters to change the behavior of the parent theme or WordPress itself.
Example: allowing SVG uploads via the child functions.php:
1 function my_child_allow_svg( $mimes ) { 2 $mimes['svg'] = 'image/svg+xml'; 3 return $mimes; 4 } 5 add_filter( 'upload_mimes', 'my_child_allow_svg' );
Never copy the ENTIRE
functions.phpfrom the parent theme into the child theme. This will cause a fatal error due to redeclared functions. The childfunctions.phpextends the parent's; it does not replace it.
Adding new template files
A child theme can contain templates that do not exist in the parent. For example, you can create template-full-width.php for pages without a sidebar, and WordPress will detect it in the child theme and offer it as an option when editing a page.
Tools and text editors
Any editor works for child theme code, but syntax highlighting makes things easier. Here are some options:
- VS Code: free, with extensions for PHP and WordPress;
- Notepad++: a lightweight editor for Windows that handles CSS/PHP/JS;
- Sublime Text: fast and minimalist, paid after the trial.
For accessing files via FTP, use the FileZilla FTP client. For hosting users, the built-in cPanel file manager is perfectly adequate for creating a couple of files.

Common mistakes and how to fix them
Over years of working with child themes we have compiled a list of the most frequent stumbling blocks.
"The child theme is not recognized." Almost always this is an error in the Template: line. Check that the parent theme's folder name matches character by character, including case and hyphens. TwentyTwentyFive and twentytwentyfive are different names.
"The site shows plain HTML without styles." The child theme is activated but styles are not enqueued. Add wp_enqueue_style() in the child theme's functions.php (see Step 3).
"Fatal PHP error after activation." Most likely you copied the parent theme's functions.php into the child and now functions are declared twice. Remove the duplicates from the child functions.php; keep only YOUR functions.
"Customizer settings are gone." They are tied to the theme name. Temporarily switch back to the parent, export the settings (via a plugin or the theme's built-in tool), then activate the child and import them.
"Updating the parent theme broke the layout." The developer changed the HTML structure of a template you copied to the child theme. Your copy is now incompatible with the new styles. Solution: compare the new parent template with your copy and adapt the changes.
Step-by-step video (EN) on creating a child theme: from creating the folder to final activation and style setup. WPEstate channel, 2025, clear and without filler.
⁉️🤔 Frequently asked questions
Do I have to create a child theme for every WordPress site?
No. If you are not editing theme files and not adding custom code, you do not need a child theme. But if you have ever opened the theme editor in the admin, added CSS in Additional CSS, and plan to modify templates, create a child theme. It takes 10 minutes now and saves hours at the next update.
What happens if I delete the parent theme but keep the child theme?
The site will crash with a critical error. A child theme without its parent does not work; it does not contain a full set of files and inherits everything from the parent. Before deleting the parent theme, first delete (or deactivate) the child theme and activate a different theme.
Can I create a "grandchild" theme, a child of a child?
No. WordPress supports only one level of inheritance: parent → child. For complex customizations that do not fit into a single child theme, the proper approach is to fork the theme and create a full parent theme, or move the logic into a separate plugin.
Does a child theme work with block themes (FSE, Full Site Editing)?
Yes, but the mechanism differs slightly. In block themes the child theme's
theme.jsonis merged with the parent's rather than replacing it. Templates and template parts are overridden the same way: by creating a file with the same name in the child theme. More details are in the official Developer Resources documentation on wordpress.org.
How do I transfer customizations already made in the parent theme to the child theme?
Identify what you changed: CSS, templates, or functions.php. Copy CSS rules to the child
style.css. For modified templates, copy the files to the child theme and keep your edits there. Transfer code from the parent's functions.php selectively: only your functions, not the entire file. After the transfer, remove your edits from the parent theme; otherwise they will be lost on the next update.
Should you create a child theme right now
If you have read this far, the answer is probably yes. A child theme does not complicate the site and does not slow it down. It separates your code from the theme developer's code. It is like commenting code: at first it seems unnecessary, but a month later it saves you.
For those editing a theme for the first time: start with a sandbox. A local server (LocalWP, XAMPP) or a staging site on your hosting. Create a child theme following the steps above, add a couple of CSS rules, copy one template. When you see that everything works, repeat on your live site.
The question is not whether you need a child theme. The question is when you will remember it: before the theme update or after your customizations have vanished.



