编辑您站点的不同全局区域,如页眉、页脚、侧边栏,或创建自己的区域。

  • 名称: core/template-part
  • 类别: 主题
  • API 版本: 3
  • 块类型: 动态(服务器渲染)

属性

通过 attributes 属性在 block.json 中定义。

属性类型默认值描述
slugstring——
themestring——
tagNamestring——
areastring——

支持功能

通过 supports 属性在 block.json 中定义。

块标记

这是一个 动态块。它在服务器上渲染,不会在帖子内容中保存 HTML。

在帖子内容中,它存储为块注释:

<!-- wp:template-part {"slug":"header","theme":"twentytwenty"} /-->

来源