1.6.3 Các mẫu bổ sung Page(ok)

C:\xampp\htdocs\wp-content\themes\emptytheme\templates\page.html

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:group {"tagName":"main"} -->
<main class="wp-block-group">
  Post title: <!-- wp:post-title /-->
  Post featured image: <!-- wp:post-featured-image /-->
  Post content: <!-- wp:post-content /-->
  Post author: <!-- wp:post-author /-->
  Post date: <!-- wp:post-date /-->
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->

Ví dụ 2: Sử dụng trang cụ thể bởi id hoặc slug

C:\xampp\htdocs\wp-content\themes\emptytheme\templates\page-sample-page.html

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:group {"tagName":"main"} -->
<main class="wp-block-group">
  page-sample-page.html
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->

C:\xampp\htdocs\wp-content\themes\emptytheme\templates\page-sample-page.html

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:group {"tagName":"main"} -->
<main class="wp-block-group">
  page-2.html
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->

Last updated