WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 4 months ago

#19627 assigned feature request

Themes should be able to opt-in to a static front page

Reported by: nacin Owned by: koopersmith
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Themes Keywords:
Focuses: Cc:

Description

A theme should be able to register that they are designed to have a static front page by default. Core should then pick up on this as part of the activation process and allow them to pick or create a page, or ignore it and show posts on the front.

Twenty Twelve will most likely need this (http://wpdevel.wordpress.com/2011/12/20/default-theme-twenty-twelve/).

Attachments (1)

19627-patch1.diff (5.3 KB) - added by Master Jake 2 years ago.

Download all attachments as: .zip

Change History (41)

comment:1 iandstewart2 years ago

  • Cc iandstewart added

comment:2 chipbennett2 years ago

  • Cc chip@… added

comment:3 jaredatch2 years ago

  • Cc jared@… added

comment:4 emiluzelac2 years ago

  • Cc emil@… added

comment:5 johnbillion2 years ago

  • Cc johnbillion@… added

comment:6 bi0xid2 years ago

  • Cc raven@… added

comment:7 philiparthurmoore2 years ago

  • Cc philip@… added

comment:8 markmcwilliams2 years ago

  • Cc mark@… added

comment:9 goto102 years ago

  • Cc dromsey@… added

comment:10 rfair4042 years ago

  • Cc rfair404 added

comment:11 lancewillett2 years ago

  • Cc lancewillett added

comment:12 kwight2 years ago

  • Cc kwight@… added

comment:13 cais2 years ago

  • Cc edward.caissie@… added

comment:14 mercime2 years ago

  • Cc mercijavier@… added

comment:15 MZAWeb2 years ago

  • Cc MZAWeb added

comment:16 sabreuse2 years ago

  • Cc sabreuse@… added

comment:17 husobj2 years ago

  • Cc ben@… added

comment:18 anointed2 years ago

  • Cc anointed added

comment:19 Master Jake2 years ago

  • Cc chappellind@… added

Should it perhaps display a select box with a list of pages to choose from or simply give a notice that the theme is recommended to be used with a static home page and give a link to the reading settings page (similar to how a theme supporting widgets gives a link to configure them)?

Master Jake2 years ago

comment:20 Master Jake2 years ago

19627-patch1.diff is an example of the latter. It allows a theme to register that it is optimized to be used with a static front page template by appending the following line to the theme's style.css file:

Front Page: static

Last edited 2 years ago by Master Jake (previous) (diff)

comment:21 eddiemoya2 years ago

  • Cc eddie.moya+wptrac@… added

comment:22 Mamaduka2 years ago

  • Cc georgemamadashvili@… added

comment:23 ericlewis2 years ago

  • Cc eric.andrew.lewis@… added

comment:24 nacin2 years ago

  • Owner set to koopersmith
  • Status changed from new to assigned

This came up in IRC today during the weekly meeting. It is going to be end up being super-simple.

add_theme_support( 'static-front-page' )

All this will do is add another section to the 3.4 customizer that lets the user know the theme explicitly supports a designed static front page, and offer the same dropdown already provided for at wp-admin/options-reading.php.

Assigning to koopersmith as this will have zero implementation outside of the customizer.

comment:25 ocean902 years ago

My idea is to use something like add_theme_support( 'static-page' , array( 'front' => (ID|slug), 'posts' => (ID|slug) ), the array is optional.

The Customizer will fetch this and shows the same dropdown menu as on options-reading.php. The values, defined in the array, will be selected by default. If the user wants to use a static page, he/she just needs to check/confirm it.

comment:26 nacin2 years ago

Perhaps the add_theme_support() call could allow for a description from the theme letting them know about their implementation. A distributed theme isn't going to be able to line up post slugs or IDs.

comment:27 nacin2 years ago

I think this requires #16379 to not suck.

comment:28 ocean902 years ago

Should we just support add_theme_support( 'static-page' ) for 3.4 and maybe extend it with 3.5 and Twenty Twelve?

The Customizer should, if the theme supports it, display the setting section for a static page .

comment:29 nacin2 years ago

Any theme hypothetically supports a static front page already. I think the add_theme_support() call is only good for descriptive text as to what the theme does special when it comes to static headers (or an explicit "Your theme supports a static front page." line).

comment:30 ryan2 years ago

  • Milestone changed from 3.4 to Future Release

comment:31 karmatosed22 months ago

  • Cc karmatosed added

comment:32 lancewillett21 months ago

Discussed at dev hack day at WCSF 2012, we are going to keep it at future release and not work on this for 3.5.

comment:33 Master Jake21 months ago

  • Cc chappellind@… removed

comment:34 follow-up: chipbennett15 months ago

What are the odds that this makes the 3.6 cut?

comment:35 in reply to: ↑ 34 emiluzelac15 months ago

Replying to chipbennett:

What are the odds that this makes the 3.6 cut?

That would be great!

comment:36 kovshenin15 months ago

  • Cc kovshenin added

comment:37 toscho15 months ago

  • Cc info@… added

comment:38 chipbennett14 months ago

Potentially related: #23669

comment:39 obenland9 months ago

  • Keywords 3.8-early added

comment:40 obenland4 months ago

  • Keywords 3.8-early removed
Note: See TracTickets for help on using tickets.