[theme-reviewers] front-page.php and display of blog posts index
Otto
otto at ottodestruct.com
Sun Mar 3 01:22:38 UTC 2013
On Sat, Mar 2, 2013 at 3:36 PM, Chip Bennett <chip at chipbennett.net> wrote:
> I've just submitted a core patch that should facilitate Theme display of the
> blog posts index as the site front page for Themes that define custom static
> front page content using front-page.php:
> http://core.trac.wordpress.org/ticket/23669
>
> Essentially, if approved, this patch would modify the template hierarchy
> slightly, such that the site front page would use home.php if 'posts' ==
> get_option( 'show_on_front' ), and would only use front-page.php if 'page'
> == get_option( 'show_on_front' ).
>
> Comments/criticism/other feedback welcome!
No, I agree with Michael Fields on that one. The front-page.php file
should be used as the "front page" regardless of what the user has set
to be on the front-page. If this is not desired, then the
front-page.php file should be removed entirely.
There's basically two use cases here:
1. Theme wants to always have the front page look the same way,
regardless of user choice. Solution: Use front-page.php. Done and
done. User choice then only affects the content of that front-page, by
choosing whether to use the blog posts or the content from a static
Page.
2. Theme wants user choice to change the look of the front page.
Solution: Don't use front-page.php at all. Use home.php, which will
always be used for the blog posts regardless of location, then provide
a special Page Template (named something other than front-page.php) if
the theme wants to provide a special look for the static-page case.
The user can then choose to use that Page Template or not, as they
desire. Alternatively, you could just use page.php if the pages across
the site are all supposed to look special.
There's no real good reason I can think of to have front-page.php
check for the blog-on-front case and load home.php instead. If that is
the desired use case, then front-page.php should simply not be
included at all.
-Otto
More information about the theme-reviewers
mailing list