Ollie Theme Academy

Creating Template Parts

Template parts in block themes

Block themes maintain template parts but with significant improvements in flexibility and simplicity. Header and footer template parts are still common, but they’re just regular template parts without special status.

Template parts in block themes are stored in the /parts directory and registered through theme.json rather than relying on file naming conventions. This allows you to name files anything and have multiple template parts per area.

The site editor interface for template parts moved from a dedicated section to the patterns area in WordPress 6.2+. Template parts now appear alongside other patterns, organized by their assigned areas (header, footer, general).

Template part variations let themes provide multiple design options for the same area. Users can easily swap between different header designs without needing separate templates or custom code.

Back to: Ollie Theme Academy > Creating Template Parts