-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Gutenberg Plugin v13.9+ - Template Attribute for PHP template & theme.json conflict #45216
Comments
If I add Is it not possible to use block templates and classic templates together? |
Thanks for the thorough, detailed report. I have the same experience as well; using Gutenberg 14.0.3 (haven't tested other versions at the time) on a custom theme that uses theme.json and no block-based templates. From reading over the discussion at #42091 ; that behavior (the name of the template type should be loaded) should be fixed but it is not. @noisysocks or @Mamaduka could you clarify if this has not been fixed? |
Good to know that this should be working but maybe isn't. Thought I was going crazy. |
Can confirm this also by activating Twenty Twenty and creating an empty @Mamaduka: Looking at https://github.com/WordPress/gutenberg/pull/42091/files. The presence of |
This should be resolved after #46304. |
Description
Ever since Gutenberg Plugin v13.9+ the simple existence of the
theme.json
file in the theme causes the template label to always say Default Template if its been set to a custom PHP template. Clicking on the Label to open the popup still correctly shows which template is actually set for the page.I came across this PR #42091 when looking to see if anyone has had similar experiences. The comment by noisysocks in that conversation is the exact issue im having but based on the remainder of the conversation, i assume it was fixed before merge. There is some discussion at the bottom about
settings.availableTemplates[]
but I cant find any documentation on that anywhere. Is this something I need in my theme.json to define my PHP templates? Do i have to disable block templates? Id like to have the ability to have both block and classic as im primarily developing in a hybrid approach.At this point im not 100% sure if this is still a bug or if Im just missing something somewhere.
Ive created a simple theme with just a basic
index.php
,style.css
,theme.json
andcustom-template.php
so there are no conflicts anywhere.If I remove the
theme.json
file from the theme, then it shows up correctly.This only appears to affect classic PHP templates. As below I created an FSE Template and it works as expected even with the
theme.json
in the theme.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: