[wp-trac] [WordPress Trac] #38983: page-{slug}.php not loaded when selected as static page

WordPress Trac noreply at wordpress.org
Thu Dec 1 12:36:36 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:
-------------------------------------+------------------------------
Changes (by knutsp):

 * keywords:  reporter-feedback => reporter-feedback close


Comment:

 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 abot
 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:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list