Skip to content
WordPress Child Themes: What They Are and How to Create One
WordPress TutorialsšŸ“‹ Guide

WordPress Child Themes: What They Are and How to Create One

Can BayarCan Bayar••Updated on: •12 min read•415 views

Key Takeaways

  • āœ“Child themes inherit parent theme functionality while allowing customizations that survive parent theme updates.
  • āœ“Creating a child theme requires a new directory, style.css with template declaration, and functions.php file.
  • āœ“Customizations in child theme files override parent theme templates without modifying original code.
  • āœ“Child Theme Configurator plugin automates child theme creation and copies parent theme settings.
  • āœ“Always use child themes for CSS edits, template modifications, or custom functions to preserve changes.
```html

What Is a WordPress Child Theme?

A WordPress child theme is a theme that inherits the functionality, features, and styling of another theme called the parent theme. Instead of modifying the parent theme's files directly, you make your changes in the child theme. This preserves your customizations when the parent theme receives updates, preventing you from losing hours of careful work. For more details on how themes work, refer to the WordPress Theme Developer Handbook.

Think of it this way: the parent theme provides the foundation, and the child theme layers your modifications on top. WordPress loads the child theme first, then falls back to the parent for anything not overridden. This inheritance model is one of WordPress's most practical architectural decisions.

Why Should You Use a Child Theme?

Using a child theme is considered a standard practice among WordPress developers, and for good reason. Here are the primary advantages:

  • Update safety: Parent theme updates won't overwrite your customizations. Your code lives in a separate directory that remains untouched during updates.
  • Organized workflow: All your modifications stay in one place, making it straightforward to track what you've changed and why.
  • Easy rollback: If a customization causes problems, you can simply deactivate the child theme and revert to the parent theme instantly.
  • Learning opportunity: Building a child theme teaches you how WordPress themes work without the pressure of building one from scratch. For foundational knowledge, check the Theme Basics Guide.
  • Version control friendly: You can commit only your child theme to Git, keeping your repository clean and focused on your changes.

Child Theme vs. WordPress Customizer: When to Use Each

WordPress offers several ways to customize your site's appearance. Understanding when to use a child theme versus the built-in Customizer helps you choose the right approach for each situation.

FeatureChild ThemeWordPress Customizer
Code changes (PHP)Fully supportedNot supported
Template overridesFully supportedNot supported
CSS modificationsRecommended for large changesSuitable for small tweaks
Survives theme updatesYesYes (if using theme options)
Technical skill requiredBasic PHP/CSS knowledgeNo coding needed
Live previewRequires manual refreshBuilt-in live preview
Performance impactNegligibleNegligible

Use the Customizer when you need simple color changes, font adjustments, or logo uploads. Use a child theme when you need to modify template files, add custom functions, or make structural changes to your layout.

How to Create a Child Theme Manually

Creating a child theme requires only two files: style.css and functions.php. Here's a step-by-step walkthrough.

Step 1: Create the Child Theme Directory

Connect to your WordPress installation via FTP or your hosting file manager. Navigate to wp-content/themes/ and create a new folder. The naming convention is parent-theme-name-child. For example, if your parent theme is Astra, name the folder astra-child.

Step 2: Create style.css

Inside your new folder, create a file called style.css with the following header:

/*
 Theme Name:   Astra Child
 Theme URI:    https://yoursite.com
 Description:  Child theme for Astra
 Author:       Your Name
 Template:     astra
 Version:      1.0.0
*/

The Template line is critical. It must exactly match the parent theme's directory name (not the display name). Check wp-content/themes/ to confirm the exact folder name.

Step 3: Create functions.php

Create a functions.php file that properly enqueues the parent and child stylesheets:

<?php
function child_theme_enqueue_styles() {
    wp_enqueue_style(
        'parent-style',
        get_template_directory_uri() . '/style.css'
    );
    wp_enqueue_style(
        'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array('parent-style'),
        wp_get_theme()->get('Version')
    );
}
add_action('wp_enqueue_scripts', 'child_theme_enqueue_styles');

This approach ensures the parent stylesheet loads first, followed by your child theme's styles, maintaining the correct cascade order.

Step 4: Activate the Child Theme

Go to Appearance > Themes in your WordPress dashboard. You should see your child theme listed. Click Activate. Your site should look identical to before because the child theme inherits everything from the parent.

Using a Plugin to Create Child Themes

If you prefer a no-code approach, several plugins can generate child themes for you. The most widely used option is the Child Theme Configurator plugin. Here's how it works:

  1. Install and activate the Child Theme Configurator plugin from Plugins > Add New.
  2. Navigate to Tools > Child Themes.
  3. Select your parent theme from the dropdown.
  4. Click Analyze to check for potential issues.
  5. Click Create New Child Theme.
  6. The plugin generates all required files and optionally copies widget and menu settings.

This method is faster but gives you less control over the initial setup. For production sites, understanding the manual process is valuable because it helps you troubleshoot issues that may arise later.

Common Customizations in a Child Theme

Once your child theme is active, you can start making modifications. Here are the most frequent customization scenarios.

Overriding Template Files

To modify a template file, copy it from the parent theme directory to your child theme directory, maintaining the same folder structure. For example, to customize the single post template:

  1. Find single.php in your parent theme's folder.
  2. Copy it to your child theme's folder.
  3. Edit the copy in your child theme.

WordPress will automatically use the child theme's version instead of the parent's.

Adding Custom CSS

Add your CSS rules to the child theme's style.css file, below the header comment. Since the child stylesheet loads after the parent's, your rules take precedence:

/* Custom header background */
.site-header {
    background-color: #2c3e50;
    padding: 20px 0;
}

/* Adjust post title size */
.entry-title {
    font-size: 2rem;
    line-height: 1.3;
}

Adding Custom Functions

The child theme's functions.php runs in addition to the parent's (not instead of). You can add custom shortcodes, widget areas, post types, or modify existing behavior using WordPress hooks:

// Add a custom widget area
function child_register_sidebar() {
    register_sidebar(array(
        'name'          => 'Custom Sidebar',
        'id'            => 'custom-sidebar',
        'before_widget' => '<div class="widget">',
        'after_widget'  => '</div>',
    ));
}
add_action('widgets_init', 'child_register_sidebar');

Customizing Header and Footer

Copy header.php or footer.php from the parent theme to your child theme, then modify them. This is how you add custom navigation elements, tracking scripts, or structural changes to these critical areas.

When NOT to Use a Child Theme

Child themes are not always the right solution. Here are scenarios where alternatives make more sense:

  • Minor CSS tweaks: For a few lines of CSS, use the Customizer's Additional CSS section. Creating a child theme for three CSS rules adds unnecessary complexity.
  • Functionality additions: If you're adding features unrelated to the theme (custom post types, shortcodes, integrations), use a custom plugin instead. This keeps your functionality theme-independent.
  • Page builder sites: If you build entirely with Elementor Pro or similar page builders, most customizations happen within the builder. A child theme adds little value here.
  • Starter themes: If you're building a completely custom design, start with a starter theme like Underscores (_s) or use a framework. A child theme implies you want to preserve the parent's design.

Choosing a Parent Theme for Your Child Theme

Not all parent themes work equally well for child theme development. Look for themes that are well-coded, regularly updated, and designed with extensibility in mind. Two popular choices include:

  • Astra Pro: Known for its lightweight codebase, extensive hook system, and clear documentation for child theme developers. Astra provides dozens of action and filter hooks specifically for child theme customization.
  • GeneratePress Premium: Offers a clean, well-structured codebase with modular components. Its Hook system allows inserting content at various points without overriding template files.

Both themes maintain backward compatibility across updates, which is essential when building child themes that need to remain stable over time. For comprehensive guidance on child themes, refer to the Child Themes Documentation.

Troubleshooting Common Child Theme Issues

Even experienced developers run into problems with child themes. Here are solutions to the most common issues:

ProblemLikely CauseSolution
White screen after activationPHP syntax error in functions.phpAccess files via FTP and check for typos, missing semicolons, or unclosed brackets
Styles not applyingIncorrect enqueue order or missing parent styleVerify wp_enqueue_style dependencies array
Template override not workingWrong file path or namingEnsure the file path in child theme mirrors the parent theme structure exactly
Theme not appearing in dashboardIncorrect Template value in style.cssCheck that Template matches the parent's directory name (case-sensitive)
Functions running twiceBoth parent and child define the same functionUse function_exists() checks or different function names

Child Theme Folder Structure Reference

A well-organized child theme follows this structure:

your-theme-child/
ā”œā”€ā”€ style.css              (required - theme header + custom CSS)
ā”œā”€ā”€ functions.php          (required - enqueue styles + custom functions)
ā”œā”€ā”€ screenshot.png         (optional - theme thumbnail)
ā”œā”€ā”€ header.php             (optional - header override)
ā”œā”€ā”€ footer.php             (optional - footer override)
ā”œā”€ā”€ single.php             (optional - single post override)
ā”œā”€ā”€ page.php               (optional - page override)
ā”œā”€ā”€ template-parts/        (optional - partial overrides)
│   └── content-single.php
ā”œā”€ā”€ assets/                (optional - custom assets)
│   ā”œā”€ā”€ css/
│   ā”œā”€ā”€ js/
│   └── images/
└── woocommerce/           (optional - WooCommerce overrides)
    └── single-product.php

For more information on selecting a parent theme, see our guide on how to choose a WordPress theme in 2026. If you need help installing a theme before creating a child theme, check our WordPress theme installation tutorial.

Frequently Asked Questions

Do I lose my child theme customizations when I update WordPress itself?

No. WordPress core updates do not affect themes. Your child theme and its parent theme remain in their respective directories under wp-content/themes/. Only parent theme updates could potentially cause compatibility issues, but your child theme files remain untouched.

Can I have a child theme of a child theme (grandchild theme)?

WordPress does not natively support grandchild themes. A child theme can only inherit from a parent theme, not from another child theme. If you need multiple layers of customization, use a combination of the child theme and custom plugins.

Will a child theme slow down my website?

The performance impact of a child theme is negligible. WordPress loads an additional style.css and functions.php file, which adds a fraction of a millisecond to page load time. The overhead is not measurable in real-world conditions.

Can I use a child theme with any WordPress theme?

Technically yes, but some themes work with child themes more reliably than others. Themes that follow WordPress coding standards and use proper hook systems are easier to extend. Themes that rely heavily on hardcoded paths or proprietary frameworks may cause unexpected behavior.

How do I migrate a child theme from a staging site to production?

Copy the entire child theme folder from wp-content/themes/your-child-theme/ to the same location on your production server. Then activate it from the WordPress dashboard. If your child theme references specific URLs, update those after migration.

Should I use a child theme with a starter theme like Underscores?

Starter themes like Underscores are designed to be modified directly. They're meant as starting points for custom themes, not as parent themes for child themes. Modify them directly and track changes with version control instead.

What happens if I deactivate the parent theme?

If the parent theme is deactivated or deleted, the child theme will break. WordPress cannot load a child theme without its parent. Always keep the parent theme installed, even if you only use the child theme.

Build on a Solid Foundation

Astra Pro provides extensive hook support and clean code architecture, making it a reliable parent theme for your child theme projects.

Explore Astra Pro →
```

Frequently Asked Questions

Do I need a child theme if I only use the Customizer?
If your customizations are limited to options available in the WordPress Customizer (colors, fonts, menus, widgets), a child theme is not strictly necessary. The Customizer stores settings in the database, which persists through theme updates.
Will a child theme slow down my website?
A properly created child theme adds negligible overhead. It loads one additional small CSS file and functions.php file. The performance impact is unmeasurable in practice.
Can I create a child theme for any WordPress theme?
Yes, you can create a child theme for any WordPress theme. However, some themes like Divi and Avada have their own customization systems that may make child themes less necessary. Check the theme documentation for specific recommendations.
What happens to my child theme if I change the parent theme?
Your child theme is tied to a specific parent theme. If you switch to a different parent theme, the child theme will no longer work. You would need to create a new child theme based on the new parent theme and migrate your customizations.
How do I update a parent theme without losing child theme changes?
That is exactly what child themes solve. When you update the parent theme, only the parent theme files are replaced. Your child theme files remain untouched, and your customizations are preserved automatically.

Share this post

About the Author

Can Bayar
Can Bayar

WordPress Expert

Senior WordPress developer with over 10 years of experience in plugin and theme development. Specialized in WooCommerce, Elementor, and performance optimization.

WordPressWooCommerceElementorPHPJavaScriptPerformance Optimization

Stay Updated

Get the latest WordPress tips and tutorials delivered to your inbox.