本文档介绍了 WordPress 主题与区块编辑器的交互方式,包括经典主题和区块主题的定义、区别及其配置选项。重点强调了 theme.json 文件在提供全局设置和样式控制中的作用。
The block editor provides a number of options for theme designers and developers, to interact with it, including theme-defined color settings, font size control, and much more.
In terms of block editor terminology this is any theme that defines its templates in the traditional .php file format, and that doesn’t have an index.html format template in the /block-templates or /templates folders. A Classic theme has the ability to provide configuration and styling options to the block editor, and block content, via Theme Supports, or by including a theme.json file. A theme does not have to be a Block theme in order to take advantage of some of the flexibility provided by the use of a theme.json file.
This is any theme that has, at a minimum, an index.html format template in the /block-templates or /templates folders, and with templates provided in form of block content markup. While many Block themes will make use of a theme.json file to provide configuration and styling settings, a theme.json is not a requirement of Block themes. The advantage of Block themes is that the block editor can be used to edit all areas of the site: headers, footers, sidebars, etc.
There isn’t an FSE specific theme type. In WordPress > 5.9 FSE is enabled for any Block theme, ie. any theme that has an index.html format template in the /block-templates or /templates folders.
Contents