admin管理员组文章数量:1122846
For example, you can create a posts template within the site editor, but how do you make it so that the content for each respective single post displays dynamically?
Here's my single post template code:
<!-- wp:heading -->
<h2 class="wp-block-heading"></h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->
I know that I can create PHP templates on the back-end, but do dynamic content tags exist in this context to insert post title and post content to my template on the front-end?
For example, you can create a posts template within the site editor, but how do you make it so that the content for each respective single post displays dynamically?
Here's my single post template code:
<!-- wp:heading -->
<h2 class="wp-block-heading"></h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->
I know that I can create PHP templates on the back-end, but do dynamic content tags exist in this context to insert post title and post content to my template on the front-end?
Share Improve this question asked Apr 21, 2024 at 23:15 WPdummyWPdummy 235 bronze badges1 Answer
Reset to default 0Two block markup examples are the post-title block:
<!-- wp:post-title /-->
and the post-content block:
<!-- wp:post-content /-->
that you can use in your single post template.
See more here under the Query Loop list item:
https://wordpress.org/documentation/article/blocks-list/#theme-blocks
本文标签: postsIs it possible to create dynamic templates for block themes directly from the site editor
版权声明:本文标题:posts - Is it possible to create dynamic templates for block themes directly from the site editor? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736309714a1934115.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论