• kingchris

    (@kingchris)


    Hello,

    I’m experiencing an issue where template parts are missing from page templates when I install an exported or cloned theme. This also happens when I overwrite a theme. The template parts themselves still exist, but the instances of them are removed from page templates, requiring me to add them back in one by one. You can imagine this becomes painfully tedious when updating themes on multple sites. Here is an example of what shows up where the template part was: “Template part has been deleted or is unavailable: header”

    I have version 1.13.1 installed.

    I also saw that there was a previous post on this topic as well as an issue on GitHub:

    https://wordpress.org/support/topic/the-templates-parts-are-missing-after-exporting-the-theme/

    https://github.com/WordPress/create-block-theme/issues/242

    Any help would be greatly appreciated! Thanks!

    • This topic was modified 1 year ago by kingchris.
    • This topic was modified 1 year ago by kingchris.
Viewing 13 replies - 1 through 13 (of 13 total)
  • Moderator Felipe Santos

    (@foosantos)

    Hi there,

    I understand that after you export the theme and try to import on a new site, you get an error message for the custom header that you tried to import.

    Can you confirm if you are only using native blocks and tools for creating the header?

    These issues are likely not related to what added from GitHub and seems like a conflict with the theme or a specific plugin.

    Thread Starter kingchris

    (@kingchris)

    @foosantos Only using native core blocks. This is happening with all my template parts, too. Not just the header. It happens on a fresh install of WordPress with no plugins installed and only Twenty-Twenty-Three theme installed, which I delete after installing my custom block theme.

    Moderator Felipe Santos

    (@foosantos)

    Hi @kingchris, thank you for clarifying that!

    I have a few questions in order to try reproducing this issue:

    • Which is the theme that you’re cloning?
    • Can you share the key changes that you had with the theme before cloning/exporting it?
    • Has this worked as expected to you at some point?

    I have an easy way to reproduce it, so I will share it versions

    • WP 6.3
    • Create Block Theme Plugin 1.13.2

    Steps

    • create blank theme from CBT
    • put the image block in index template
    • save as theme files to use CBT

    With the above, the header and footer parts will be lost links from the index template. reason

    Moves images to the assets folder when a block about images is included.
    Also. Save a file called index.php in the part directory.

    The link seems to be lost at this point.

    • This reply was modified 11 months, 2 weeks ago by megane9988.

    I also posted it as an issue on GitHub.
    https://github.com/WordPress/create-block-theme/issues/448

    Moderator jordesign

    (@jordesign)

    Thanks @megane9988 – for something like this – the GH repo is definitely a good place to have it looked at.

    I also wanted to check if any of the recommendations in this thread help (as it has some similarities). it’s sometimes to do with the Theme Name which is referenced in the new theme.

    https://wordpress.org/support/topic/block-theme-not-exporting-header-and-footer/?view=all

    Thread Starter kingchris

    (@kingchris)

    @jordesign Thanks for referencing that other thread!

    I made sure the theme name that was exported is the same, but the problem persists.

    The thing that’s odd about what I’m experiencing is that this is only happening on 3 of my templates. The rest are fine. What I noticed about the affected ones is that the missing template-parts don’t have the theme attribute assigned to them, which is really strange because they are there on the theme I exported from. Once I add them in, the template-parts show up. So, it definitely has something to do with the theme attribute. I’m not sure where to go from here tho. Thx!

    Moderator jordesign

    (@jordesign)

    @kingchris Can I just please check if you have the most recent version of the Gutenberg plugin running when you run into this problem?

    Thread Starter kingchris

    (@kingchris)

    Hey @jordesign, Gutenberg is not installed on the website I’m installing the exported theme on. As far as the website I’m exporting the theme from goes, I’ve tried exporting with the latest version of Gutenberg activated as well as with it uninstalled. I experience the issue either way.

    Moderator jordesign

    (@jordesign)

    Hey @kingchris – digging in a little deeper it sounds like the issue is similar to this reported one?

    https://github.com/WordPress/create-block-theme/issues/429

    Does that seem the same? it may be worth checking the steps recommended in that thread as well.

    Thread Starter kingchris

    (@kingchris)

    Hey @jordesign, that is definitely the same issue I’m experiencing! The theme name attribute is being omitted from the template-part code during export. When I add it back to the newly exported theme, the template-parts show up. This manual fix wouldn’t be a problem if it were just one site, but I’m using this theme on many sites, so you can imagine fixing this manually each time I need to update the theme could get quite tedious. Do you know if there is a fix for this issue coming? Thanks!

    Moderator jordesign

    (@jordesign)

    @kingchris I’m not a developer on the plugin I’m afraid – so I can’t know for sure. But certainly following that GH issue is the best place for updates.

    Thread Starter kingchris

    (@kingchris)

    @jordesign No worries! Thanks for your help and pointing me in the right direction!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Template Parts Missing’ is closed to new replies.