gutenbergdocs/how-to-guides/themes/README.md
2025-10-22 01:33:45 +08:00

22 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 主题
区块编辑器为主题设计师和开发者提供了多种交互选项,包括主题定义的颜色设置、字体大小控制等功能。
## 主题类型
### 经典主题
在区块编辑器的术语体系中,指那些采用传统`.php`文件格式定义模板,且在`/block-templates`或`/templates`文件夹中不包含`index.html`格式模板的主题。经典主题可通过[主题支持功能](/docs/how-to-guides/themes/theme-support.md)或引入[theme.json](/docs/how-to-guides/themes/global-settings-and-styles.md)文件,为区块编辑器及区块内容提供配置与样式选项。即使不是区块主题,也能通过使用`theme.json`文件获得灵活配置能力。
### 区块主题
指至少在`/block-templates`或`/templates`文件夹中包含`index.html`格式模板,并以区块内容标记形式提供模板的主题。虽然多数区块主题会使用`theme.json`文件进行配置和样式设置,但该文件并非区块主题的必备要素。区块主题的优势在于可以通过区块编辑器编辑网站所有区域:页眉、页脚、侧边栏等。
### 全站编辑FSE
并不存在特定的FSE主题类型。在WordPress 5.9及以上版本中,所有区块主题(即在`/block-templates`或`/templates`文件夹中包含`index.html`格式模板的主题)均支持全站编辑功能。
**目录**
- [全局设置theme.json](/docs/how-to-guides/themes/global-settings-and-styles.md)
- [主题支持](/docs/how-to-guides/themes/theme-support.md)