[wp-trac] [WordPress Trac] #23669: Allow front page template to fall back to home template when site displays blog posts index on front page

WordPress Trac noreply at wordpress.org
Sun Mar 3 04:31:18 UTC 2013

#23669: Allow front page template to fall back to home template when site displays
blog posts index on front page
 Reporter:  chipbennett              |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Template                 |     Version:  3.5.1
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |

Comment (by chipbennett):

 Replying to [comment:8 mfields]:
 > I disagree. This change would have an impact on any theme that is
 currently using front-page.php as defined by both behavior in core and
 documentation in the Codex. If such a theme is installed on a user's site
 and the site is set to display recent posts on the front-page, the
 template that displays these posts will switch from front-page.php to
 home.php or index.php. The proposed change makes the assumption that
 home|index.php has been designed to display recent posts in the same
 manner as front-page.php has. The possibility exists that this is not
 true. In the event that the theme provides a front page specific items in
 front-page.php these items will be removed from the user's Front Page
 because they are not implemented in home|index.php.

 Are there many such Themes?

 > I can see where developers could get confused by the name of the
 template - for sure. While the name of the template is more-than-likely
 the cause for this confusion but, I do not believe that it is a good
 argument for theme developers to use the template incorrectly.

 The problem is that this is not an isolated or edge-case issue. It is
 widespread to the point of being mainstream. We've spent the past three
 years getting developers to stop misusing `home.php` as the static front
 page template, but in so doing, `front-page.php` has proliferated
 primarily as a static-page-only template, with no consideration for the
 use case of displaying the blog posts index on the front page.

 > I see this as a feature rather than a bug. The option in core states
 "Front page displays" and then provides the option to choose the latest
 posts or static page content. A loop can be added to front-page.php to
 display either the post content or the page content. I works in both
 contexts. If further customization is needed "content" templates can be
 used and toggled by ```is_page()```.

 How is it a ''feature'' when the user has configured the site to display
 the Blog Posts Index on the site front page, and the Theme instead
 displays a static page template? Merely including some variation of a
 "recent posts" loop does not cause the static page template to be
 equivalent to the blog posts index template.

 > I think that education is the best way to go here. If a lot of
 developers are missing the intended use of this template, than we should
 find a way to bring this to their attention - maybe through tutorials,
 theme review guidelines, and/or codex updates.

 It is because of efforts to educate/enforce proper usage of `front-
 page.php` via Theme reviews that I have realized the need for this change.
 Education and Guidelines enforcement isn't working.

 > I think that this change to template hierarchy has the potential to be
 obtrusive as well as remove a very useful feature that themes can take
 advantage of to cut down on code duplication as well as provide a better
 user experience when themes are viewed in the Live Preview.

 Yes, the Live Preview seems to be a sticking point for a lot of
 developers. Once #19627 gets approved, the Live Previewer will have a way
 to determine whether to display the static page template or the blog posts
 index on the front page.

Ticket URL: <http://core.trac.wordpress.org/ticket/23669#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list