Fix: Child Theme Not Overriding
Five causes, in order of likelihood. One of them is definitely your issue.
Last updated: October 2026
Open the child theme's style.css. The first block of the file must contain a header like this:
/*
Theme Name: My Child Theme
Template: parent-theme-folder-name
*/
If Template: is missing or doesn't match the parent theme's folder name exactly, that's your problem. Fix it, then reactivate the theme.
The 5 real causes
Missing or incorrect Template header
WordPress identifies the parent theme through the Template: header. If it's missing, wrong, or has trailing whitespace, the child theme becomes a standalone theme — and only the child's styles load.
/* wp-content/themes/my-child/style.css */
/*
Theme Name: My Child Theme
Template: twentytwentyfour
Version: 1.0
*/
/* Your overrides go below */
Gotcha: Template: must match the parent's folder name, not the theme's display name. If the parent folder is twentytwentyfour, use exactly that — not "Twenty Twenty-Four".
Parent stylesheet not enqueued
Some child themes need to explicitly enqueue the parent theme's stylesheet. Without this, the child theme only loads its own CSS — so nothing looks like the parent.
// wp-content/themes/my-child/functions.php
<?php
add_action('wp_enqueue_scripts', function () {
// Enqueue parent styles first
wp_enqueue_style(
'parent-style',
get_template_directory_uri() . '/style.css'
);
// Enqueue child styles second (they override)
wp_enqueue_style(
'child-style',
get_stylesheet_uri(),
['parent-style'], // Loads after parent
wp_get_theme()->get('Version')
);
});
Pro tip: Many modern themes (Twenty Twenty-Four, Astra, GeneratePress) already enqueue the parent. Check the theme's documentation before adding this.
Caching — plugin, browser, or CDN
The styles are loading fine, but you're seeing the cached version. Rule this out before blaming the theme.
# Browser hard refresh
Ctrl+Shift+R (Windows/Linux)
Cmd+Shift+R (macOS)
# Or open in Incognito/Private mode
# Then check your WordPress cache
# Admin bar → Purge All Caches
# Cloudflare → Caching → Purge Everything
Pro tip: If it works in Incognito but not your normal browser, it's browser cache. If it works in neither, purge the WordPress/CDN cache.
CSS specificity — parent rule is more specific
Your CSS loads after the parent's, but the parent's selector has higher specificity, so it still wins. DevTools shows this clearly — your rule appears with a strikethrough.
/* Parent theme rule (loaded first) */
.site-header .nav-menu > li > a {
color: blue;
}
/* Your child theme rule (loaded second) */
.nav-menu a {
color: red; /* ❌ Loses — parent has higher specificity */
}
/* ✅ Fix: match or exceed the parent's specificity */
.site-header .nav-menu > li > a {
color: red;
}
Pro tip: Right-click the element in DevTools → Inspect. In the Styles panel, find your rule. If it's crossed out, specificity is the issue. Hover over the strikethrough to see which rule is winning.
Block theme (FSE) — style.css isn't used the same way
If the parent is a block theme (Twenty Twenty-Four, Twenty Twenty-Five, Ollie), style.css is often ignored. Styles live in theme.json and block-level settings.
/* In a block theme, edit theme.json instead */
// wp-content/themes/my-child/theme.json
{
"version": 2,
"styles": {
"color": {
"text": "#e2e8f0",
"background": "#0f172a"
},
"typography": {
"fontSize": "16px"
}
}
}
How to check: In Appearance → Themes, block themes show the FSE icon. If you're not sure, look for theme.json in the parent theme folder — if it exists, you're dealing with a block theme.
The debugging workflow
- Check the Template header. 60% of cases. Open child theme's style.css — does the header exist and match the parent folder name?
- Check DevTools Network tab. Is your child's style.css loaded at all? If 404, the file isn't where you think it is.
- Hard refresh + Incognito. Rule out browser cache in 10 seconds.
- Purge all caches. WordPress plugin, host, and CDN. All of them.
- Check DevTools Elements → Styles. Find your rule. If crossed out, specificity is the issue.
- Verify the child theme is active. Appearance → Themes → active theme should say "My Child Theme", not the parent.
- Check for block theme. If parent has theme.json, style.css may be irrelevant.
📁 A complete working child theme
Everything you need in 3 files, from scratch:
wp-content/themes/my-child/
├── style.css
└── functions.php
style.css
/*
Theme Name: My Child Theme
Template: twentytwentyfour
Version: 1.0.0
Text Domain: my-child
*/
/* Your overrides go here */
.site-header {
background: #0f172a;
}
functions.php
<?php
add_action('wp_enqueue_scripts', function () {
// Only enqueue if the parent theme doesn't already.
// Most modern themes handle this. Comment out if you see duplicates.
wp_enqueue_style(
'my-child-style',
get_stylesheet_uri(),
[],
wp_get_theme()->get('Version')
);
});
Then: Appearance → Themes → Activate "My Child Theme". If the parent name in the header is wrong, WordPress shows it as a standalone theme (no "Parent Theme" indicator).
🛡️ How to avoid this next time
- Generate child themes with a tool. The "Child Theme Configurator" plugin or the official theme generator gets the header right every time.
- Check the header twice. Template: must match the parent's folder name, not its display name.
- Keep child theme CSS small. Only overrides. Inherit everything else from the parent.
- Version your CSS file. Add a version query parameter so browsers don't cache stale CSS.
- Use one child theme per parent. Nested children don't work the way most people expect.
- For block themes, use theme.json. Don't fight the block editor — work with it.
❓ Frequently asked questions
Why is my WordPress child theme not overriding the parent?
The most common cause is a missing 'Template:' header in the child theme's style.css, or forgetting to enqueue the parent stylesheet in functions.php. Other causes: browser caching, CSS specificity, or using a block theme where style.css is ignored.
What must the child theme style.css contain?
A CSS comment header with at least Theme Name and Template. The Template value must exactly match the parent theme's folder name, or WordPress won't recognize the parent.
How do I enqueue the parent theme styles correctly?
In the child theme's functions.php, use wp_enqueue_style to load the parent stylesheet before the child, and set the child's dependency to the parent's handle. Example: wp_enqueue_style('child', get_stylesheet_uri(), ['parent-handle']);
Does a child theme work with block themes?
Block themes use theme.json instead of style.css for most styling. A child theme can still work, but customizations should target theme.json and block-level styles rather than adding rules to style.css.
How do I confirm the child theme is active?
Go to Appearance → Themes. The active theme should be the child theme, not the parent. Also, the child's folder should show up in the theme list with 'Child' typically appended or with the parent's screenshot.