WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#11055 closed enhancement (fixed)

Support page-{slug}.php and page-{id}.php template files for pages

Reported by: aaroncampbell Owned by:
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Template Keywords: has-patch needs-testing
Focuses: Cc:

Description

According to the documentation the order for page templates is 'pagename.php'->'page.php'->'index.php' but it doesn't work like that. Currently it just supports 'selected custom template'->'page.php'->'index.php'. I talked to beaulebens and westi in IRC and suggested that the new order works more like the tag templates and goes like this:

'custom template'->'page-{slug}.php'->'page-{id}.php'->'page.php'->'index.php'

Attachments (1)

11055.001.diff (2.0 KB) - added by aaroncampbell 4 years ago.

Download all attachments as: .zip

Change History (4)

aaroncampbell4 years ago

comment:1 aaroncampbell4 years ago

  • Cc aaron@… added
  • Keywords has-patch needs-testing added

comment:2 westi4 years ago

  • Milestone changed from 3.0 to 2.9

comment:3 westi4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [12135]) Improve get_page_template() to search based on slug and id as well. Fixes #11055 props aaroncampbell.

Note: See TracTickets for help on using tickets.