• Just like the title. When I update changes made in the Site Editor and use the Overwrite feature, all the HTML elements set to Template Parts will be set back to <div>. Because of this, I need to manually set them back to the semantic HTML elements I selected respectively. Are there any workarounds for this issue? Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Matias Benedetto

    (@mmaattiiaass)

    Hi @keinskyrocket , thanks for reporting your issue.

    Could please share an example with markup before and after running the “Overwrite” option of the plugin? I mean: the markup you are using and the markup you get after running “Overwrite”. That would be very useful to debug.

    Thanks!

    Thread Starter keinskyrocket

    (@keinskyrocket)

    @mmaattiiaass Here you are:

    Before:

    <!-- wp:template-part {"slug":"header-general-2","theme":"ksk-portfolio","area":"header"} /-->

    After:

    <!-- wp:template-part {"slug":"header-general-2","area":"header"} /-->

    Before => I grabbed the code from Site Editor

    After => The code is from templates/front-page.html

    This is the part that was different between before and after. I grabbed this line from my Front Page template and the rest is identical. The "theme" part was added to the After version with a value that is the same as the folder name after I activated the theme folder from the WP admin page.

    I assume there is some missing info stored in the DB that didn’t get exported? These screenshots might help you see what was changed:

    Before:

    After:

    Hi!

    The missing theme slug in the template part code is unrelated to the HTML tag used.
    The theme slug does not need to be included in a template for the template part to work (If I remember correctly the slug does need to be included when the template part code is part of a block pattern).

    Neither the before nor after code includes the attribute that changes the HTML tag.

    The attribute is called tagName, here is an example of how the markup would look with the div changed to <header>:

    <!-- wp:template-part {"slug":"header","tagName":"header"} /-->

    Moderator jordesign

    (@jordesign)

    Hi @keinskyrocket – just checking in to see how you went with this. Were you able to try out @poena’s suggestion?

    I can also recommend updating to the most recent version of the Create Block Theme plugin as some time has gone by.

    If your question has been answered, we would love if you would mark this topic as resolved in the sidebar. This helps our volunteers find the topics that still need attention and more people will get helped, possibly like you did.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Issue with HTML element removed after overwriting Block Theme’ is closed to new replies.