Points of concern when using Parts in Fragment

I have a concern about the use of Parts in Fragment.
I used to insert header and footer parts individually in Templates, but I tried to insert header and footer parts using Fragment with the help of the video.

Then the header tag set in the following topic is gone.
It may be more correct to say that the WordPress default settings are gone rather than that the header tag is gone.
The template parts above were inserted in bulk by Fragment.

202206020423

Since the markup changes depending on how the header and footer are inserted, it may be necessary to understand how to use either method.:thinking:

Hello @Takeru,

Might I ask where you set the <header> tag for the Template Part?
Correct me if I’m wrong, but you apply that specific attribute when applying the Template Part with a Template Part block (which acts as a container).

When using the Template Part in a Global Fragment, there is no Template Part block = no container = no container tag

Furthermore, the Template Part tag you see can change from one Template Part block to another for the same Template Part.

I set this up as a reference.

Rather than using the Wordpress default parts as described above, this is more convenient to mark up as you wish.

Exactly. The Template Part Block attributes (which you change the tag for) don’t affect the Template Part in itself.

We are definitely considering removing the Template Part container (this would be provided as an option) so that only the markup inside it is used.

1 Like