[wp-trac] [WordPress Trac] #28763: Behavior of template heirarchy in settings -> reading when posts page is set but not front page displays

WordPress Trac noreply at wordpress.org
Mon Jul 7 15:05:05 UTC 2014


#28763: Behavior of template heirarchy in settings -> reading when posts page is
set but not front page displays
--------------------------+------------------------------
 Reporter:  Frumph        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Themes        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  template
--------------------------+------------------------------

Comment (by chipbennett):

 I'm not trying to be argumentative. I'm trying to understand exactly how
 to recreate the issue, and what exactly the issue is.

 So, start with a clean install (core-bundled Theme, no Plugins, default
 configuration):

 * `get_option( 'show_on_front' )` = `'posts'` (front page displays blog
 posts index
 * `get_option( 'page_on_front' )` = `NULL` (Settings -> Reading -> Front
 Page dropdown is disabled)
 * `get_option( 'posts_page' ) = `NULL` (Settings -> Reading -> Posts page
 dropdown is disabled)

 That's how things are initially. So, from here, I'm trying to understand
 how we get to the issue you observe. Is this it?

 1. Create two static pages, A and B
 2. Settings -> Reading -> Front page displays = "A static page"
 3. Settings -> Reading -> Front page = ''not set''
 4. Settings -> Reading -> Posts page = Static Page B

 If this is it, then I understand how you get there; but it clearly an
 incomplete configuration. The user has indicated ''I want to use a static
 page as site front page'', but has not specified ''what static page to
 use'' as the site front page.

 > setting of the posts page and not a front page in the settings ->
 reading, works, the UI allows it; it makes the posts page and the domains
 landing page both is_home() - if no front page is set in the settings it
 should default the domains landing page to is_front_page() instead.

 And what would that accomplish? WordPress would still not know what to
 output on the site front page. It won't have a page ID to query for
 `get_option( 'page_on_front' )`, so it's still going to show the blog
 posts index.

 '''As an alternate proposal to handle this incorrect configuration, I
 recommend:'''

 * Not allowing `get_option( 'posts_page' )` to be set unless `get_option(
 'page_on_front' )` is set
 * Not allowing `'page' == get_option( 'show_on_front' )` to be set unless
 both `get_option( 'posts_page' )` and `get_option( 'page_on_front' )` are
 set)
 * Providing an admin notice regarding the incorrect/incomplete
 configuration.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28763#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list