Opened 2 years ago
Last modified 9 months ago
#58236 new defect (bug)
theme.json customTemplates with child themes work wrong
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.3 |
Component: | Editor | Keywords: | needs-testing |
Focuses: | template | Cc: |
Description
If you use child themes, then customTemplates in theme.json does not work and behaves badly
- It is not possible to delete or overwrite parent custom template - neither false nor empty array helps
- It is not possible to create a new custom template - it simply does not appear
- and what is strange - if you try to create your own custom template, it will throw away the naming and parent template at that position, so then when you select the template for the page, it doesn't show the title but the name. Example - if you make a child theme from twenty-three, and you type
"customTemplates": [ { "name": "no-title", "postTypes": [ "page" ], "title": "No title" }],
so when the page is selected, it will display 'blank' instead of 'Blank' (blank is the name of the first template in the parent twenty-three theme). If you try
"customTemplates": [{}, { "name": "no-title", "postTypes": [ "page" ], "title": "No title" }],
so when you select a page, it will display "blog-alternative" instead of Blog (Alternative) (blog-alternative is the second template in the parent theme).
Child template can't be added like this even in the fourth position
Unfortunately, this makes the whole thing completely unusable.
Attachments (2)
Change History (3)
@
2 years ago
that wrong named parent template is shown also in the left list of templates on site-editor.php
#1
@
9 months ago
- Keywords needs-testing added
Hi @thomask
I am not sure that all of the issues are existing bugs. They may have been solved since WordPress 6.3, are you available to test them again?
1) To delete a parent theme template with a child theme, add an empty file with the same file name. The parent template will no longer be selectable.
2) To replace an existing parent theme template with a template in a child theme, you also add a file with the same name.
- If I use a HTML template, I am not able to reproduce the part where you are saying that the child theme template is not showing. In my test I am able to use the child theme template.
- If I try to replace it with a PHP template, it is not showing as an option in the block editor, it can't be selected. See https://core.trac.wordpress.org/ticket/61210
3) I am not able to reproduce this using 6.6 RC2.
This is an example of that mentioned third problem