[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 02:35:19 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 mfields):
Replying to [comment:6 chipbennett]:
> Further, this change would have absolutely no impact on the
wordpress.com Themes that include `front-page.php`. The change would be
completely invisible to users who have set their site front page to
display a static page.
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.
> The problem is that developers - logically - don't account for the valid
user option of displaying the blog posts index on the site front page.
Typically (and almost exclusively), `front-page.php` is coded only to
display static front page content, and does not account for the need to
display the blog posts index.
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.
> Thus, what happens currently is that users can configure their site to
display the blog posts index as the site front page, and the Theme would
display the custom `front-page.php` content instead of the blog posts
index.
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()```.
> 1. Force developers to code `front-page.php` such that it behaves as
described in the Codex, which would require some variation of the
conditional output as shown in the ticket description
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.
> 2. Make a simple, unobtrusive change to allow the front page to fall
back to the home template if the user has configured the site to display
the blog posts index as the site front page.
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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23669#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list