WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#22131 closed defect (bug) (fixed)

front-page.php only applied to static page

Reported by: mfields Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: Themes Keywords:
Focuses: Cc:

Description

I was doing a bit of template testing this morning when I noticed that template hierarchy may be broke in the latest trunk. Steps to reproduce:

  1. Create a test theme with front-page.php and index.php.
  2. Ensure that Settings -> Reading -> "Enable a static front page" is unchecked.
  3. Visit http://example.com/

At this point, index.php is used to load the content.

  1. Check the Settings -> Reading -> "Enable a static front page" option.
  2. Visit http://example.com/

At this point, front-page.php is used to load the content.

I ran the same test in 3.4.2 and front-page.php was always loaded for http://example.com/ regardless of the Settings -> Reading -> "Front page displays" setting.

Change History (4)

#1 @nacin
7 years ago

  • Milestone changed from Awaiting Review to 3.5
  • Owner set to nacin
  • Status changed from new to assigned

#2 @nacin
7 years ago

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

In [22135]:

Set show_on_front to 'posts' when no value is set. This occurs when the show_on_front checkbox is left unchecked and then sent through options.php. fixes #22131.

#3 @nacin
7 years ago

The issue was that show_on_front, when options-reading.php was saved, was getting set to an empty value.

#4 @mfields
7 years ago

Wow! Lightning fast :) Just wanted to post that I tested [22135] and it works for me. Thanks!

Note: See TracTickets for help on using tickets.