WordPress Child Themes: When You Need One, How to Create One, and Template Overrides | Simple Automation Solutions

WordPress Development

WordPress Child Themes: When You Need One, How to Create One, and Template Overrides

Every WordPress customisation tutorial says use a child theme. Here is the full explanation of why, when, and exactly how to create one correctly.

SAS

Simple Automation Solutions

··⌛ 9 min read

Parent
theme updates overwrite direct edits
functions.php
always customise in child theme
Template
override by copying to child theme folder
WooCommerce
uses its own override path in child theme

Every WordPress customisation tutorial says the same thing: use a child theme. But most tutorials do not explain why, what the risks of not using one are, or how to create one correctly. This guide covers all of it — including when a child theme is necessary and when it is not.

What a child theme actually is

A child theme is a WordPress theme that inherits the design and functionality of another theme (the parent theme) while allowing you to safely override specific files and styles. When WordPress loads your site, it checks the child theme first for any template file. If found, it uses the child theme’s version. If not, it falls back to the parent theme’s version.

This means you can customise any template file from your parent theme by copying it to your child theme and editing the copy — your parent theme file remains unchanged. When the parent theme updates, your customisations in the child theme are preserved.

The key risk of not using a child theme

If you edit your parent theme’s files directly and the theme updates, all your customisations are overwritten. This is not a theoretical risk — theme updates happen regularly, and the one you do not expect will always be the one that deletes your carefully added code.

When you need a child theme

  • Modifying a theme’s PHP template files: editing header.php, footer.php, single.php, functions.php — always requires a child theme
  • Adding custom functions.php code: custom hooks, custom post type registrations, custom shortcodes — always add to a child theme’s functions.php
  • Adding CSS that is not available in the theme customiser: targeted CSS overrides that require knowing specific selectors
  • Overriding WooCommerce templates: customising product pages, cart, or checkout — copy WooCommerce templates to your child theme

When you do NOT need a child theme

  • Adding custom CSS through the WordPress Customiser: Appearance › Customise › Additional CSS survives theme updates without a child theme
  • Using a page builder like Elementor or Divi: page builders store their layout data in the WordPress database, not in theme files — no child theme needed for Elementor layouts
  • Adding code snippets via a snippets plugin: WPCode or Code Snippets plugin stores custom code in the database rather than theme files — a safe alternative to editing functions.php
  • Using a standalone plugin for custom functionality: custom post types, custom shortcodes, and custom functions should ideally be in a plugin anyway

Creating a child theme manually

1
Create a new folder in wp-content/themes/

Name it something descriptive like ‘astra-child’ or ‘hello-elementor-child’. Connect via FTP, SFTP, or your hosting file manager.

2
Create style.css in the child theme folder

This file is mandatory. At minimum it must contain the Theme Name and Template headers. Add: /* Theme Name: Astra Child / Template: astra */ — Template must match the parent theme’s folder name exactly.

3
Create functions.php in the child theme folder

Add a wp_enqueue_style action to load the parent theme’s stylesheet: add_action('wp_enqueue_scripts', function(){ wp_enqueue_style('parent-style', get_template_directory_uri().'/style.css'); });

4
Activate the child theme

Go to Appearance › Themes. Your child theme will appear in the list. Click Activate. Your site should look identical to before — the child theme inherits everything from the parent.

5
Verify everything works

Check your site on the frontend. Check your admin. Verify plugins are functioning correctly. If something looks broken, the most common cause is a typo in the Template header or a missing parent stylesheet enqueue.

Creating a child theme with a plugin

If you prefer not to create files manually, several plugins automate child theme creation:

Free
Child Theme Configurator
Creates a complete child theme with a visual interface. Can scan the parent theme and copy specific styles into the child theme. Most thorough free option.
Free
One Click Child Theme
The simplest option — one click creates a basic child theme. No configuration options. Good for straightforward setups.
Free
Child Theme Wizard
Creates the required files and prompts you to configure the child theme name, description, and author before generating it.

Overriding parent theme templates

To override a specific template file from your parent theme:

1
Locate the file in your parent theme

The file you want to customise is in your parent theme’s folder (e.g. wp-content/themes/astra/). Common files: header.php, footer.php, single.php, archive.php, page.php.

2
Copy it to your child theme

Copy the file (do not move it) to the same relative path in your child theme folder: wp-content/themes/astra-child/single.php

3
Edit the child theme version

Edit only the copy in your child theme folder. WordPress will now use your child theme’s version of this file instead of the parent theme’s version.

4
Test thoroughly

Check every page type that uses this template. A mistake in a template file can break multiple pages simultaneously.

Overriding WooCommerce templates

WooCommerce templates follow a different override path. Copy WooCommerce template files from wp-content/plugins/woocommerce/templates/ to wp-content/themes/your-child-theme/woocommerce/ maintaining the same subfolder structure. WooCommerce checks this location before using its own templates.

WooCommerce template versions

When WooCommerce updates, its templates may change. If your child theme contains an overridden WooCommerce template from an older version, WooCommerce displays a warning in the admin. Review and update overridden templates after major WooCommerce version updates to prevent compatibility issues.

Need a child theme created and configured for your WordPress site?

Simple Automation Solutions creates child themes, adds custom functionality, and configures WordPress themes correctly for businesses worldwide.

Frequently asked questions

Does using a child theme slow down my WordPress site?+

No. A child theme adds negligible overhead — typically one additional file lookup and one additional CSS load. The performance impact is immeasurable in real-world usage. If your child theme is slow, the cause is the code you have added to it (heavy PHP, unoptimised JavaScript), not the child theme architecture itself.

Can I use a child theme with Elementor?+

Yes, and it is a recommended practice. Even if you build all your pages with Elementor, a child theme is the correct place for any PHP customisations, custom hooks, and CSS that affects elements outside of Elementor’s control. Elementor layouts are stored in the WordPress database and are unaffected by theme updates — but functions.php code and template overrides still need a child theme for safety.

What happens if I delete my parent theme?+

WordPress would deactivate your child theme and revert to a default theme, because the child theme depends on the parent theme being present. Never delete the parent theme of an active child theme. If you want to switch to a completely different theme, create a new child theme of the new parent and migrate your customisations.

SAS
Simple Automation Solutions
Global WordPress Development Studio · Pakistan

Simple Automation Solutions is a global digital product studio specialising in WordPress and Bubble.io. We serve founders, startups, and businesses worldwide — delivering production-ready websites built to rank, convert, and scale.

Simple Automation Solutions

Business Process Automation, Technology Consulting for Businesses, IT Solutions for Digital Transformation and Enterprise System Modernization, Web Applications Development, Mobile Applications Development, MVP Development

Copyright © 2026