#41665 closed defect (bug) (invalid)
Theme Parent Templates Missing From Metabox: page-attributes
Reported by: | michael.ecklund | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.8.1 |
Component: | Themes | Keywords: | |
Focuses: | ui, administration | Cc: |
Description
I have two themes.
Parent Theme and Child Theme.
Child Theme is the active theme.
As per the Theme Developer Handbook, Creating Custom Page Templates for Global Use.
I've defined a simple page template to be used globally like so:
<?php /** * Template Name: One Column */ // .... ?>
The above code is placed into a file called one-column.php
and for simplicity, placed into the theme root directory of the parent theme.
When I edit a page in the backend, the page-attributes
metabox has no option for a drop down menu at all. Yet, clearly I have a page template defined in the parent theme. It should be showing up, shouldn't it?
Now... If I take the same exact page template file and move it into the root directory of the active child theme, and edit a page in the backend, the page-attributes
metabox suddenly has a dropdown menu containing my page template (as expected).
My question is, why are page templates defined in the parent theme of the active child theme completely ignored?
Now to further test my point even more. Leave the one-column.php
file in the root directory of the active child theme and add another page template file called two-columns.php
and place this file into the root directory of the parent theme.
Contents of two-columns.php
:
<?php /** * Template Name: Two Columns */ // .... ?>
Edit a page, and take a gander at the dropdown menu in the page-attributes
metabox. You will only see the page template of "One Column" as defined by one-column.php
in the root directory of the active child theme. You will not see "Two Columns" as defined by two-columns.php
defined in the root directory of the parent theme.
Potential Start on Tracing/Debugging:
./wp-admin/includes/meta-boxes.php
Line 865
./wp-admin/includes/template.php
Line 771
./wp-admin/includes/theme.php
Line 112
I tested this in my local environment but could not re-create the issue. I'm pretty sure there is some small theme specific issue or plugin conflict.