Make WordPress Core

Opened 3 years ago

Last modified 3 months ago

#15513 reopened defect (bug)

Home Page fails to use page template sometimes

Reported by: filosofo Owned by: filosofo
Milestone: Future Release Priority: normal
Severity: normal Version: 3.1
Component: Themes Keywords: has-patch 3.2-early
Focuses: template Cc:


If a page is the home page but not also the front page and it has a page template, the page template is ignored. This behavior is counter-intuitive:

  • When editing the home-page page, either normally or with quick edit, the page template is shown as being the template.
  • When acting as a front page, a page uses its page template if available.

Attachments (1)

use-page-template-for-home-page-if-exists.15513.diff (522 bytes) - added by filosofo 3 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 acsnaterse3 years ago

I've the same problem here, but this solution seems not to work for me.

I've tried to debug it a bit as far as I could and I found that on line 1415/1416 of query.php it's going wrong.

On a "working" install the $_query is empty when you have a page template as homepage. If it's not empty it should have the array keys that are in the if-statement.

However on the install where it goes wrong, this is the content (print_r) of the $_query array:

    [page] => 
    [pagename] => 

Of course I can change the if statement, so it will also match these two keys, but I don;t feel that would be the right solution.


comment:2 acsnaterse3 years ago

Don't know what it was exactly, but it seems to work all now by using the latest nightly (from 14-12-2010).. so my comment above can be ignored..

comment:3 ryan3 years ago

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

(In [16915]) Honor the page template when a page is the home page but not also the front page. Props filosofo. fixes #15513

comment:5 nacin3 years ago

  • Keywords 3.2-early added
  • Milestone changed from 3.1 to Future Release
  • Resolution fixed deleted
  • Status changed from closed to reopened

Per #15945 and IRC discussion.

  • Revert for 3.1. Punt to 3.2.
  • Block or reset page templates for home pages. May need an upgrade routine. Need to prevent #15945 from affecting existing pages suddenly changing on core update.

comment:6 nacin3 months ago

  • Component changed from Template to Themes
  • Focuses template added
Note: See TracTickets for help on using tickets.