WordPress

Parent theme

Parent theme is the complete WordPress theme that a child theme builds on. It provides the templates, styles, and functions the child does not replace.

How it is measured

The relationship is declared in the child's style.css by a Template: line that names the parent's directory. In code, get_template_directory() returns the parent's path, and get_stylesheet_directory() returns the active child's path. In Appearance > Themes, the child's details panel shows Parent: followed by its name.

WordPress needs the parent folder to remain in wp-content/themes. If it is missing, the child shows as broken with the message The parent theme is missing.

Worked example

A nonprofit uses the Kadence theme with a child named kadence-donate. During spring cleaning an intern deletes all inactive themes, including the parent folder kadence, because it showed no Active badge. The site front end falls back to a default theme and the donate button disappears.

Re-uploading the same version of the parent folder fixes it. The nonprofit now keeps the parent's version number in a README beside the child.

How it differs

A parent theme is a theme that works on its own. A child theme has no complete templates and cannot stand alone. If you update the parent, the child keeps its overrides, but a template in the child that was copied from an old parent version can drift out of date and miss fixes.

Common errors

Deleting an inactive-looking parent. Updating it without reading the changelog for renamed template files. Editing the parent directly instead of the child. Changing the parent's folder name and breaking the Template header. Buying a theme bundle and not knowing whether the package contains both.

In practice

For each site, write the parent name and version beside the child's name. Before updating, compare any copied template files with the new parent version. Never delete a theme folder that the child lists as its Template.

See also

Child theme, Theme

Sources

Count this on a real site.

Watch my website