Technote

Themes & plugins Practical

Series Making a theme feel like your brand Part 4 of 8

Template overrides: the copy freezes the moment you make it

Copy a parent file into your child theme and yours wins. It also stops receiving the parent's fixes — you have taken on its maintenance.

Some things CSS cannot do: reorder elements, surface information that is not on the page, or change the markup structure itself. That is what template overrides are for.

The mechanism is the one from part two. WordPress looks in the child theme first, so a file at the same path with the same name as one in the parent takes precedence.

Mirror the path exactly

To change the parent’s wp-content/themes/acme/template-parts/content.php, copy it to wp-content/themes/acme-child/template-parts/content.php. The intermediate folder names have to match too — drop the file loose in the child theme root and WordPress will never look at it, which reads as nothing happening at all.

There is one exception. Never copy functions.php. That file alone is loaded in addition to the parent’s rather than instead of it, so a copy declares the same functions twice and takes the whole site down.

Also worth knowing: some themes use their own loader. Most load template parts the standard way, so overrides work as described, but a few call a custom function that points straight at the parent folder. If you copy a file and nothing changes, check how the theme loads that file before assuming your path is wrong.

The override procedure — stopping at the first step is the best outcome

The copy freezes

This is the part that matters. When the parent theme updates, its templates improve too — accessibility attributes get added, image markup moves to a newer approach, escaping gets tightened. None of that reaches the file you copied, because yours wins.

An override is therefore a declaration: “I will maintain this file from now on.” That is not a bad thing, it is a choice with a price — and a price you know about is one you can manage.

Managing it is simple. In a comment at the top of the copied file, note which parent version you copied it from. At update time, diff that version of the file against the new one and fold any changes into your copy. Whether that one line exists completely changes how hard the comparison is a year later.

Questions to ask before copying

Pre-copy check — the top four make an override maintainable

If the theme offers a hook or a filter, take it every time. Code attached through a hook keeps working as the parent template improves; a copy simply stops receiving those improvements. The best override is the one you did not make, and the second best is a single small file.

How this runs inside a real project is published on our process page, and untangling a site that has accumulated many copies is covered in the development workflow archive.

Next part

Part five returns to CSS. When a rule you clearly wrote does not take effect, the cause is usually order rather than specificity — so here is what to check before reaching for !important.

More on this topic

All technotes

Themes & plugins Practical

Decide the editable regions before you design them

A design the CMS cannot express stays up for negotiation long after it ships. Deciding what editors may change, first, removes the negotiation entirely.

Designers 6 min read

₩270,000 · Join the program