Key takeaways
- A child theme inherits everything from a parent theme and lets you override styles, templates and functions safely.
- Your changes survive parent theme updates.
- You need just two files to start:
style.cssandfunctions.php.
Editing your theme’s files directly feels quick — until the next theme update wipes out every change. A child theme solves that. It’s the standard way to customise classic WordPress themes beyond what the Customizer allows.
When you need a child theme#
| Change | Child theme needed? |
|---|---|
| Colours, fonts, logo via theme settings | No |
| A few CSS tweaks | No — Additional CSS is fine |
| Modifying template files (header, single post) | Yes |
| Adding PHP functions, hooks, custom post types | Yes (or a site-specific plugin) |
| Large custom stylesheet | Yes |
Create a child theme in 5 minutes#
- In
wp-content/themes/, create a folder, e.g.generatepress-child. - Create
style.css:/* Theme Name: GeneratePress Child Template: generatepress Version: 1.0.0 */Templatemust match the parent theme’s folder name exactly. - Create
functions.phpto load the stylesheets:<?php add_action( 'wp_enqueue_scripts', function () { wp_enqueue_style( 'child-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ) ); }, 20 );Many modern parent themes load their own CSS automatically; check whether you also need to enqueue the parent stylesheet.
- Zip the folder and upload via Appearance → Themes → Add New, or upload by SFTP.
- Activate the child theme. Re-check menus and widgets — and Customizer settings, which are stored per theme (most themes offer an import/export option).
Need a hand with this?
Get a quick, honest review of your website’s SEO.
Overriding templates#
Copy a template file from the parent (e.g. single.php or template-parts/content.php) into the same path in your child theme and edit it there. WordPress uses the child version automatically. Keep overrides minimal — the more you copy, the more you have to update when the parent changes.
Using hooks instead of copying files#
// Add a call-to-action after every post
add_filter( 'the_content', function ( $content ) {
if ( is_singular( 'post' ) ) {
$content .= '<p class="cta">Need help? <a href="/contact/">Get in touch</a>.</p>';
}
return $content;
} );
Hooks (actions and filters) are more update-proof than template copies.
Block themes#
For block themes, much customisation happens in the Site Editor and theme.json. Child themes still work: add your own theme.json to override settings and a templates/ folder for template changes.
Child theme FAQ#
Does a child theme slow down my site?#
No meaningful impact — it’s one extra small stylesheet at most.
Should a custom-built theme have a child theme?#
If the theme was built specifically for you and won’t receive third-party updates, you can edit it directly with version control.
What about code snippets plugins?#
For small PHP snippets independent of the theme, a snippets plugin or site-specific plugin is a good alternative.