admin管理员组文章数量:1122826
I have two working blocks hero Carousel and hero Carousel Slide. When I hard code these blocks in the template file they do not appear nested in the editor. In the editor, I am able to drag and drop the child block into the parent block as well as use the + icon to add the child block into the parent. How does one invoke blocks with nested blocks in a template file, when creating a bespoke theme.
in front-page.html
<!-- wp:mytheme/herocarousel /-->
<!-- wp:mytheme/herocarouselslide /-->
<!-- /wp:mytheme/herocarousel /-->
I have two working blocks hero Carousel and hero Carousel Slide. When I hard code these blocks in the template file they do not appear nested in the editor. In the editor, I am able to drag and drop the child block into the parent block as well as use the + icon to add the child block into the parent. How does one invoke blocks with nested blocks in a template file, when creating a bespoke theme.
in front-page.html
<!-- wp:mytheme/herocarousel /-->
<!-- wp:mytheme/herocarouselslide /-->
<!-- /wp:mytheme/herocarousel /-->
Share
Improve this question
edited Jun 11, 2024 at 23:08
pjbrusven
asked Jun 11, 2024 at 22:44
pjbrusvenpjbrusven
11 bronze badge
1 Answer
Reset to default 1If you insert things the way you want in the editor and then copy and paste them you'll get the correct output.
The mistake you've made here is the /
closing the block comment:
<!-- wp:mytheme/herocarousel /-->
Should be:
<!-- wp:mytheme/herocarousel -->
Only use /-->
if the block has no content or children.
本文标签: Hard code block with nested block in frontpagehtml template
版权声明:本文标题:Hard code block with nested block in front-page.html template 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736303976a1932069.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论