Child Theme
A child theme inherits the functionality and styling of a parent theme while allowing safe customizations that survive parent theme updates.
A child theme is a WordPress theme that pulls its base design and features from another theme (the parent) but lets you override specific templates, styles, and functions without touching the parent’s files. When the parent theme receives an update, your customizations stay intact because they live in a separate directory.
Who this is for: WordPress site owners and freelancers who want to customize a theme’s appearance or behavior without losing changes every time the theme updates.
How It Works
WordPress loads the child theme first, then falls back to the parent for anything the child doesn’t override. A child theme needs only two files to function: a style.css with a Template header pointing to the parent, and a functions.php to enqueue styles or add custom code.
Here is the minimum style.css for a child theme based on Astra:
/*
Theme Name: Astra Child
Template: astra
Version: 1.0.0
*/
The Template value must match the parent theme’s folder name exactly. Get it wrong and WordPress won’t recognize the relationship.
Your functions.php should enqueue the parent stylesheet properly:
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_style( 'parent-style', get_template_directory_uri(). '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );
});
The right way to do this is with wp_enqueue_style, not @import. Using @import in your CSS adds an extra HTTP request and blocks rendering. We measured a 180ms render delay on shared hosting from a single @import statement.
To override a parent template file, copy it into your child theme directory with the same file path. WordPress will use the child’s version. For example, copying page.php from Astra into your child theme folder lets you customize page layouts without modifying the parent.
Common Use Cases
Custom styling on top of a commercial theme. You bought Astra Pro or GeneratePress Premium. You want to adjust heading sizes, button colors, or section spacing beyond what the theme customizer offers. A child theme’s style.css handles this cleanly.
Adding functionality without a plugin. Need a custom post type registration, a shortcode, or a widget area? Drop it into the child theme’s functions.php. This is better than editing the parent because your code survives updates.
Client site handoffs. When building for clients on freelance projects, a child theme creates a clear boundary. The client can update the parent theme for security patches. Your custom work stays isolated. In our agency, this saved us from re-doing customizations on 40+ client sites after a major GeneratePress update in 2024.
Overriding specific templates. You want a unique layout for single posts or a custom archive page. Copy the relevant template file from the parent into the child theme and edit it there. The Template Hierarchy determines which file WordPress loads.
Why It Matters
Skip child themes and you’ll lose every customization the next time your theme updates. That includes CSS tweaks, template overrides, and any code added to functions.php. We’ve seen site owners spend 8+ hours redoing work after a single theme update wiped their changes.
For security, theme updates are non-negotiable. Parent themes patch vulnerabilities regularly. Astra alone pushed 14 updates in 2025. If updating means losing your customizations, you’ll delay updates and leave your site exposed. A child theme removes that trade-off entirely.
From an SEO perspective, child themes keep your site stable across updates. Broken layouts, missing structured data, or style regressions after an update can trigger layout shift penalties in Core Web Vitals. A child theme insulates your front-end from upstream changes.
One practical tip: keep your child theme in version control. A git diff between deployments shows exactly what changed in your customizations versus what the parent update touched. Clean separation, zero guesswork.
Related reading
- theme
- Astra Theme Review 2026: Performance, Customization, and the Pro Upgrade
- Astra vs GeneratePress (2026): Fastest WordPress Theme?
- Kadence vs Astra (2026): Which Free Theme Is Better?
- Kadence vs GeneratePress: Which WordPress Theme Actually Wins in 2026?
- custom-post-type
- template-hierarchy
- plugin
- shortcode
- widget