New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

Themes

How to fix a WordPress child theme not working

A child theme extends a parent theme without editing vendor files. When it fails, the cause is usually a wrong Template line, missing parent, or functions.php loading parent styles incorrectly.

Time: 20-35 minutes Level: Intermediate

What this problem looks like

Child themes live in their own folder but depend on a parent theme for most templates. WordPress reads the Template header in child style.css to locate that parent.

Linux hosting is case-sensitive. Template: MyTheme fails if the folder is named mytheme.

Never edit parent theme files directly when a child is meant to hold customizations. Parent updates will overwrite those edits.

Minimum child theme files

A valid child needs style.css with headers and optionally functions.php. Other templates override parent files only when copied into the child folder.

css
/*
Theme Name: My Theme Child
Template: my-parent-theme
Version: 1.0.0
*/

Load parent styles correctly

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

Symptoms and fixes

  • Broken parent theme is missing: install and activate parent first.
  • Unstyled layout: parent CSS not enqueued in functions.php.
  • White screen: syntax error in child functions.php. Check debug.log.
  • Wrong templates loading: child file names must match parent template filenames.
Use get_stylesheet_directory() for child paths and get_template_directory() for parent paths in PHP.

Recover when the child whitescreens

Rename the child theme folder via SFTP to disable it. WordPress falls back to the parent if it was active underneath or to a default theme.

Fix functions.php locally, upload the corrected file, and reactivate.

Block themes and full site editing

FSE themes use theme.json and templates in the Site Editor. Child theme setup differs from classic themes. Follow the parent author FSE child documentation when available.

When to stop DIY and hire help

Child theme PHP errors are quick to fix with logs but scary on production. BugShield developers repair theme errors and restore layouts at a confirmed fixed price.

FAQs

Does the child need every parent template copied?

No. WordPress falls back to parent templates for files not present in the child folder.

Can I rename the parent theme folder?

No. The child Template header must match the parent directory slug. Renaming the parent breaks the child.

Why are my child CSS changes ignored?

Caching plugins and CDNs serve old CSS. Purge cache and bump the Version in style.css.

Should I activate parent or child?

Always activate the child. Activating only the parent ignores child overrides.

Rather someone else fixed it?

Request a fix at a confirmed price. Named UK developer, secure Vault, direct chat.

Request a Fix