Page using a custom template lacks template parts defined in the template

[ad_1]

What am I not understanding about templates and template parts in 6.1.2? A page using a template that has a template part with a “Media & Text” block does not display that (template part) block in the page editor. The page renders with an empty “Media & Text” block because I was unable to add images to the block in the page editor.

Theme: 2023 (block theme)

Template Part: “media-library”
site-editor.php?postType=wp\_template\_part&postId=twentytwentythree%2F%2Fmedia-library
Has a single block with a “Media & Text” block (not a reusable block)

Template: “Issues”
site-editor.php?postType=wp\_template&postId=twentytwentythree%2F%2Fwp-custom-template-issues
Has a single template part block with the media-library template part

Page: “Issues”
Uses the “Issues” template

Expected Results: Creating a new page and selecting the “Issue” template for the page, I expected a “Media & Text” block to appear in the page editor where I could add content and set with/other setting of the block.

Actual Results: The page editor was blank. When I inspected the page preview, I see that an empty “Media & Text” block was rendered:

`<div class=”wp-site-blocks”>`
`<div class=”wp-block-template-part”>`
`<div class=”wp-block-media-text alignwide is-stacked-on-mobile ctp-media-lib has-large-font-size”><figure class=”wp-block-media-text__media”></figure><div class=”wp-block-media-text__content”>`
`<p style=”padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px”></p>`
`</div></div>`
`</div></div>`

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer