Ollie Theme Academy

Creating Template Parts

Template part variations

Template part variations let themes provide multiple design options for the same functional area. WordPress TwentyTwentyTwo demonstrates this with three different header designs: default, dark small, and dark large variations.

All variations register to the same template part area (like “header”) in theme.json and appear as separate blocks in the inserter. Users can access them individually or use the “replace header” interface for easy switching.

The replacement interface is currently limited to header and footer template parts – other areas don’t get this quick-switch functionality. This makes header and footer variations particularly valuable for user experience.

Use template part variations when you want to offer design choices (different header layouts) or context-specific designs (different headers for different page types). It’s more user-friendly than requiring custom template creation.

Back to: Ollie Theme Academy > Creating Template Parts