[wp-trac] [WordPress Trac] #39740: Twenty Seventeen: Allow child themes to use front-page.php when front page is set to "Your Latest Posts"

WordPress Trac noreply at wordpress.org
Fri Feb 3 07:01:23 UTC 2017


#39740: Twenty Seventeen: Allow child themes to use front-page.php when front page
is set to "Your Latest Posts"
---------------------------+-----------------------
 Reporter:  johnnyb        |       Owner:
     Type:  defect (bug)   |      Status:  reopened
 Priority:  normal         |   Milestone:
Component:  Bundled Theme  |     Version:  4.7
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+-----------------------

Comment (by johnnyb):

 Hi @davidakennedy :

 My use-case is a bit weird. I'm working on a website with a highly-
 customized front page - it pulls several posts of a Custom Post Type and
 puts them together with a pile of animations & effects, so the front page
 is largely hand-coded, with bits of content coming from the CPT, but for
 the rest of the site we're using TwentySeventeen to give us templates,
 (it's great we can set the header image and be nearly done).

 I want the fancy front page to be as performant as possible, so I'm using
 the `pre_get_posts` action to modify the main WP_Query before it's
 executed and tell it to get the special front-page content. Since
 WordPress relies on the __results__ of the main query to help it choose
 between `front-page.php` and `index.php` when the Front Page setting is
 set to a Page, and I'm changing the query so that front page is never
 queried, I need to have the Reading setting set to "Your Latest Posts" in
 order for my `front-page.php` to work, (there seems to be a WP bug to file
 somewhere - maybe something like "Stop is_front_page() from relying on the
 WP Query"

 > I'm open to fixing this, and making it better so long as we don't break
 existing sites. We probably just can't turn it off for all child themes
 because they could want the existing functionality.

 It sounds like we're between a rock & a hard place here. FIxing this is
 likely to cause more outcry than doing nothing. However, I can tell you,
 it's **really** frustrating to read the docs & WordPress code, understand
 that I'm doing everything "right," and find that a WP-blessed default
 theme is changing that well-documented behaviour, and loose a bunch of
 time to that.

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


More information about the wp-trac mailing list