Opened 8 years ago
Last modified 7 years ago
#39773 new defect (bug)
Users Can Wrongly Set a Custom Page Template when front-page.php is in Use
Reported by: | davidakennedy | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | |
Focuses: | Cc: |
Description
If you try to set a custom page template in a theme that uses a front-page.php
, front-page.php
always wins. This is expected, but a user doesn't know that. They're still able to save the page, and it looks like it should work, but on the front end, front-page.php
wins, and they may be left confused.
Discovered while researching #39299.
Steps to reproduce:
- Activate Twenty Seventeen.
- Set the front page to a static page.
- Create a page template.
- Assign it to the static page being used as the front page.
- Save.
- Visit front end – the template isn't used.
What I expected?
At the very least – WordPress doesn't save this change, and provides an error message. Better: The page template selection box doesn't show up in this case because setting a template when the front page is a static page and a theme has front-page.php
isn't possible.
Attachments (1)
Change History (3)
#1
follow-up:
↓ 2
@
8 years ago
- Version trunk deleted
The page template selection box doesn't show up in this case because setting a template when the front page is a static page and a theme has front-page.php isn't possible.
What if the page template was previously set, i.e. before the page was chosen as the static front page.
While we're at it: what about the posts page?
#2
in reply to:
↑ 1
@
7 years ago
Replying to swissspidy:
While we're at it: what about the posts page?
It's not possible to set a page template for the posts page.
Shows static page with template in use in theme with front-page.php