[wp-hackers] front-page.php always overrides home.php?

Jeremy Clarke jer at simianuprising.com
Sun Apr 24 13:05:55 UTC 2011

On Fri, Nov 19, 2010 at 3:44 PM, Chip Bennett <chip at chipbennett.net> wrote:

> To follow up, here's what I'm thinking of submitting as a patch:
> Replace is_home() with is_posts_index() - or is_posts() or is_blog_index()
> or is_blog()
> Replace home.php with posts.php - or posts-index.php or blog.php
I'm late to the game but I just want to say: This is exactly right and would
be a huge improvement to the semantic usability of the
conditionals/templates involved.

As soon as WP had these two conditionals existing at the same time it was a
problem. There should never have been two flags like this with such
obviously redundant names. "home" and "front_page" refer to the exact same
thing here (the root of the domain/landing page up on arrival), even if the
code has them doing different things. As you point out it's almost funny and
ironic that the only functional difference between the two is that one of
them specifically applies when the home/front-page *meaning* is inverted and
you are not on the 'homepage' of the site.

is_home should have been changed to is_posts or is_posts_index as soon as
front_page was added, or preferably, home could have been used as
'front-page' and a 'posts index' could have been the 'new'
template/conditional that was added, which would have made sense!
Unfortunately at the time they seem to have been focussing on the
functionality rather than the semantics, which is a lesson for the future if
nothing else.

FWIW since those days there has been really high-quality debates around
these kinds of semantic issues when new stuff is added, and the result is a
lot less naming madness. Even if you don't like how naming in the
CPT/Multisite etc. areas have gone down, they were discussed deeply and the
results are usually workable if not ideal for everyone.

> So, two questions:
> 1) Is this reasonable to mark up as a patch and submit a Trac ticket, or is
> it a waste of time?
I think having a ticket about the subject would be good, as the issue will
never go away until someone is willing to deprecate "*home*" as used in this
context. IMHO a nice long deprecation period should make it not-unreasonable
to one day be rid of it, and cleaning up the core code would probably make
it a lot easier to understand (since the labels would make more sense)

That said I doubt you'd get much committer traction. The current situation
is seen as workable because WP is popular despite it, and there is little
love for purely semantic changes to core most of the time.

Jeremy Clarke • jeremyclarke.org
Code and Design • globalvoicesonline.org

More information about the wp-hackers mailing list