Opened 17 months ago

Last modified 3 months ago

#19627 assigned feature request

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

Reported by: nacin Owned by: koopersmith
Priority: normal Milestone: Future Release
Component: Themes Version:
Severity: normal Keywords:
Cc: iandstewart, chip@…, jared@…, emil@…, johnbillion@…, raven@…, philip@…, mark@…, dromsey@…, rfair404, lancewillett, kwight@…, edward.caissie@…, mercijavier@…, MZAWeb, sabreuse@…, ben@…, anointed, eddie.moya+wptrac@…, georgemamadashvili@…, eric.andrew.lewis@…, karmatosed, kovshenin, info@…

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 17 months ago.

Download all attachments as: .zip

Change History (39)

  • Cc iandstewart added
  • Cc chip@… added
  • Cc jared@… added
  • Cc emil@… added
  • Cc johnbillion@… added
  • Cc raven@… added
  • Cc philip@… added
  • Cc mark@… added
  • Cc dromsey@… added
  • Cc rfair404 added
  • Cc lancewillett added
  • Cc kwight@… added
  • Cc edward.caissie@… added
  • Cc mercijavier@… added
  • Cc MZAWeb added
  • Cc sabreuse@… added
  • Cc ben@… added
  • Cc anointed added
  • 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)?

19627-patch1.diff is an example of the latter.

Version 0, edited 17 months ago by Master Jake (next)
  • Cc eddie.moya+wptrac@… added
  • Cc georgemamadashvili@… added
  • Cc eric.andrew.lewis@… added
  • 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.

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.

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.

I think this requires #16379 to not suck.

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 .

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).

  • Milestone changed from 3.4 to Future Release
  • Cc karmatosed added

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.

  • Cc chappellind@… removed

comment:34 follow-up: ↓ 35   chipbennett4 months ago

What are the odds that this makes the 3.6 cut?

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

Replying to chipbennett:

What are the odds that this makes the 3.6 cut?

That would be great!

  • Cc kovshenin added
  • Cc info@… added

Potentially related: #23669

Note: See TracTickets for help on using tickets.