WordPress

Theme

Theme is the WordPress package that controls how a site looks: templates, styles, and layout. It lives in its own folder under wp-content/themes and one theme is active at a time.

How it is measured

A classic theme needs a style.css with a Theme Name: header and an index.php. A block theme needs templates/index.html instead. The active theme is stored in the template and stylesheet options. List them with wp theme list --fields=name,status,version.

Theme settings from the Customizer are saved under theme_mods_{theme-slug} in wp_options, so switching themes leaves those values behind. Query Monitor's Template panel shows which file produced the current page.

Worked example

A pet-supply shop on a custom theme named paws moves to a new design. The owner activates the new theme on a Friday. The logo, header colors, and menu locations all reset because they were saved under theme_mods_paws, not the new theme's slug.

The developer restores them by copying the stored array to the new key with wp option get and wp option update. The homepage layout still needs rebuilding because it was in the old theme's templates.

How it differs

A theme handles presentation, while a plugin adds features that should survive when you change the look. A child theme modifies a theme without editing it. If a feature such as a custom post type lives in a theme's functions.php, it disappears from wp-admin as soon as you switch.

Common errors

Putting custom post types and shortcodes in the theme. Buying a theme bundle with 30 demo imports and keeping the demo plugins. Editing the theme directly and losing changes on update. Leaving unused themes on disk. Judging a theme by its demo, not by its page weight on your content.

In practice

Before a redesign, list what your current theme provides beyond looks: post types, shortcodes, widgets, settings. Move those to a plugin first. Test the new theme on staging with your real content and check page weight in the network tab.

See also

Child theme, Plugin

Sources

Count this on a real site.

Watch my website