模板编辑器

1 次阅读

The Template Editor is new feature that allows block editor users to edit and create templates that a page or posts uses. Similar to the post editor, this feature allows you to edit and create content using blocks, including a few new theme blocks. It is only available to content creators who are using a block theme or a classic theme that has opted into using this feature.

How to access this feature

You’ll need to use a block theme with the Gutenberg plugin installed or a classic theme that has opted into this feature. To help determine if this is right for you to explore, please review this article. Keep in mind that this feature isn’t available for everyone but will be in future releases. When creating a block template, you can use any of the blocks you’re already familiar with in the post editor along with a new set of theme blocks. These theme blocks are:

  • 网站标志
  • 站点副标题
  • 站点标题
  • Query Loop
  • 文章标题
  • 文章内容
  • 文章创建日期
  • Post Excerpt 
  • Post Featured Image
  • 文章分类目录
  • 发表标签
  • 登录/登出
  • 页面列表

如何使用模板编辑器

Note: The following steps assume you are using a theme that supports this feature.

如何编辑模板

  1. 添加一个新文章/界面
  2. 打开区块设置侧边栏并导航到页面或帖子设置选项卡(Post Settings tab)。
  3. Under the “Template” section, select the Edit option. If you don’t see the option edit at first, it’s likely because you’re not using a block theme that allows you to both create and edit the current theme templates.
  4. From there, you’ll be taken into template editing mode where you can make any changes you’d like. If you need to, you can select the Back option to go back to your content and make changes.
  5. 当您完成更改时,选择Publish并通过保存流程来确认您想要进行的更改。请记住,您可能会看到多个要保存的项目。

如何创建新模板

  1. 添加一个新文章/界面
  2. 打开区块设置侧边栏并导航到页面或帖子设置选项卡(Post Settings tab)。
  3. Under the “Template” section, select the New option.
  4. 随后系统会要求您为新模板命名。确保你的命名是一个描述性的名称,例如“Full Width”。
  5. From there, you’ll be taken into template editing mode where you can make any changes you’d like. If you need to, you can select the Back option to go back to your content and make changes.
  6. 当您完成更改时,选择Publish并通过保存流程来确认您想要进行的更改。请记住,您可能会看到多个要保存的项目。

How to assign a template to a post or page

  1. 打开需要更改模板的页面或文章。
  2. 打开区块设置侧边栏并导航到页面或帖子设置选项卡(Post Settings tab)。
  3. 在“Template”(模板)部分下,您会看到一个下拉选项,可让您选择要使用的模板。如果您没有看到下拉选项,则意味着您需要创建更多模板。

如何识别模板编辑器?

三种确定你在使用模板编辑器的方式:

  1. 打开编辑器时向您介绍此功能的欢迎指南。
Image showing a welcome guide with text introducing the template editor.

2. The dark frame that appears around the template as you’re editing.

Image showing what the template editor looks like upon entering it, including the darker background framing the editor.

3. The template name visible in the Top Bar

显示顶部工具栏设置的图像,其中列出了帖子标题和模板名称。 class=

演示模板编辑是如何工作的

资源链接

变更记录:

  • 创建 on 20210611
  • 编辑在2021年6月11日添加了一个额外来源的物品