[wp-trac] [WordPress Trac] #38983: page-{slug}.php not loaded when selected as static page
WordPress Trac
noreply at wordpress.org
Thu Dec 1 13:10:43 UTC 2016
#38983: page-{slug}.php not loaded when selected as static page
-------------------------------------+------------------------------
Reporter: bekui | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version: trunk
Severity: normal | Resolution:
Keywords: reporter-feedback close | Focuses:
-------------------------------------+------------------------------
Comment (by bekui):
Correct. Because there is a line between 'Page Shown On Front' and 'Page
Template', I expected that the same logic applies after skipping to 'Page
Template'. As is the case when it comes from 'Static Page'. With the
difference that the page-{slug}.php will be wrapped inside a front-page-
whohoo. Which isn't, and I can see why.
So.. front-page.php is the new page-{slug}.php when in comes to the front
page in Twenty Seventeen, I guess! I can live with that! Thanks for
clarifying, and sorry for the bother..
Replying to [comment:8 knutsp]:
> According to WordPress Template hierarchy
[https://developer.wordpress.org/files/2014/10/template-hierarchy.png]:
>
> When "Site Front Page", as selected in Settings, is requested by visting
the front page (root), the primary template to use is `front-page.php`.
'''Only when''' `front-page.php` '''does not exist''', WordPress will
check for a custom template and further. And when custom isn't the case
(page using default template) then it will look for
`page-$slug.php`,`page-$id.php`, `page.php`, `singular.php`, `index.php`,
in that order.
>
> So, if I understand you correctly, you are making a false assumption
about that `page-$slug.php` will be checked for and used, in case the page
in question is actually the "Site Front Page".
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38983#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list