Theme System, Customizer, and Theme Zones

Theme System, Customizer, and Theme Zones

Core manages one system theme called default. Other themes are installed and updated via the Theme Store or appropriate packages. The active theme is selected from the dashboard; The theme's PHP files should be treated as trusted code.

Theme contracts

theme.json describes identity, partials, Customizer, zone layout, assets, and Store metadata. Rendering uses slots such as header, footer, homepage, list, single post, and single page. Resolver tries assignment, active theme, then fallsback system theme.

Theme Customizer

Customizer and Theme Zones

The customizer stores values per theme folder in settings theme_mods_{folder}. Supported fields include image, menu, sidebar zone, textarea, text, and toggle. The theme should read the values with a helper and provide defaults.

Theme Zones store gadgets per theme_folder, zone, position, and ordering. The layout in the manifest only states the position contracts and defaults that can be loaded; User data remains in the database. The template should check whether the position contains a gadget, render it, and then provide an HTML fallback if it is empty.

Development

Partials are in folders like main/, single/, list/, And index/. Plugins can add gadget types through registry filters and renderers. Don't edit the system theme for changes that should persist across updates; create a Store/custom theme and test desktop, mobile, and conditions without gadgets.