Ticket #6801 (reopened enhancement)

Opened 4 months ago

Last modified 2 weeks ago

Should have a template file for front page

Reported by: AaronCampbell Assigned to: anonymous
Priority: normal Milestone: 2.9
Component: Template Version:
Severity: normal Keywords: has-patch needs-testing
Cc:

Description

Now that we have is_front_page() in addition to is_home(), I think we should have a template file for it. I'm suggesting that we use front-page.php falling back on home.php then index.php. I'm attaching a patch.

Attachments

6801.001.diff (1.3 kB) - added by AaronCampbell on 04/22/08 00:26:44.
6801.002.diff (1.3 kB) - added by AaronCampbell on 04/22/08 19:21:54.
6801.003.diff (1.2 kB) - added by AaronCampbell on 04/22/08 23:56:33.
6801.003.2.diff (1.2 kB) - added by AaronCampbell on 04/23/08 00:06:11.

Change History

04/22/08 00:26:44 changed by AaronCampbell

  • attachment 6801.001.diff added.

04/22/08 02:01:22 changed by thee17

  • milestone changed from 2.5.1 to 2.6.

04/22/08 14:49:31 changed by AaronCampbell

I'm sorry, that should have been 2.6 from the beginning. I'm not sure how/why I set it to 2.5.1

04/22/08 19:21:41 changed by AaronCampbell

The new diff (6801.002.diff), changes the fall-back order, actually creating a fork in order to keep backwards compatibility. If the user uses posts as the front page, it uses: front-page.php -> home.php -> index.php

If the user uses a static page: customTemplate -> front-page.php -> page.php -> index.php

04/22/08 19:21:54 changed by AaronCampbell

  • attachment 6801.002.diff added.

04/22/08 19:51:47 changed by AaronCampbell

  • status changed from new to closed.
  • resolution set to wontfix.

This change would require that a theme developer that includes a front-page.php use an if-else in that file to see if it's for posts or if it's a page. They can already do this in another page to accomplish the same basic thing.

While it would be handy in my cases, it would be less handy for others.

04/22/08 23:56:33 changed by AaronCampbell

  • attachment 6801.003.diff added.

04/23/08 00:02:04 changed by AaronCampbell

  • status changed from closed to reopened.
  • resolution deleted.

Trying to keep up with opinions here. It looks like it could still be useful. However, home.php is for the front page if it's posts. So, since that case is already handled, lets make this one handle just a static front page. This options does that, with the static front page going to:

CustomTemplate? -> front-page.php -> page.php -> index.php

04/23/08 00:06:11 changed by AaronCampbell

  • attachment 6801.003.2.diff added.

08/05/08 22:03:05 changed by AaronCampbell

  • milestone changed from 2.9 to 2.7.

08/08/08 18:02:54 changed by westi

  • milestone changed from 2.7 to 2.9.

The problem with this at the moment is that if you have posts on the front_page then the home template is going to win over the front_page template.

I have a feeling that front_page might want to win over home and in effect home should be come deprecated.

not sure this is 2.7 ready yet.

needs some discussion first

08/08/08 21:05:19 changed by AaronCampbell

Westi: I honestly prefer it your way, I was just trying to go for backwards compatibility. I don't use WordPress as blogging software, I use it as a CMS that has blogging software built in.

08/08/08 21:27:08 changed by santosj

I use home.php to customize the front page when using WordPress as a CMS.