If you watched Matt Mullenweg’s Q&A session at WordCamp US last weekend, it’s evident that there are significant parts of the community still clinging to the Classic Editor who would be happy for it to be supported indefinitely. For whatever reason, millions users are not ready to switch – some prefer the old editor, don’t like blocks, don’t want to learn a new system, or simply find the newer versions of WordPress too confusing.
In recognition that some users may need a transitional bridge over to the block editor, with an opportunity to dip their toes into it without breaking their whole site design, Gutenberg 14.1 will introduce the ability for theme authors to use block-based template parts in classic and hybrid themes.
Anne McCarthy, who coordinates the FSE outreach program and Gutenberg testing, posted to the Make Themes blog, calling on theme authors to test it out.
“Gradual adoption options remains a focus for the project and, increasingly, there are more ways to adopt parts rather than the whole of a feature coming to the latest version of WordPress,” McCarthy said. “The aim is to allow folks to adopt what they need as they are ready in a way that is still future forward.”
Theme authors will need to specify block-template-parts theme support and use Gutenberg trunk or Gutenberg 14.1 when it’s released on September 15th, 2022. Then they can add block-based template parts as HTML files placed into the parts directory inside the root of the theme. These can then be output inside the theme’s PHP templates using the block_template_part function.
“Users will see a new ‘Template Parts’ menu visible under ‘Appearance,’ which displays a list of template parts,” McCarthy said. “From there, all theme blocks are available, but the environment is inherently limited compared to block themes. For example, users can edit existing template parts but not delete them or create new ones.”
McCarthy suggested a few use cases for adding block-based template parts to classic themes – enabling authors to offer a header template part that allows users to set a video or image background, adjust the focal point, move blocks around, or offer a footer with design blocks locked but content that is easy to edit.
“While this feature is currently aimed at providing options for themes, plugins can also explore extending this functionality to enable the same UI for users,” McCarthy said.
Block themes represent just 2.5% of WordPress themes in the directory, so this new capability is applicable to the majority of themes. Motivating classic theme authors to support this in their themes is another challenge if they don’t see the benefit to users or determine that the different editing experience would be too confusing. It may have an easier entry point through plugins, as users may be more likely to embrace a different editing UI for plugin functionality.
For more technical details and code examples for adding theme support, check out the post outlining how to test using block-based template parts in classic themes.