[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
Mon Jan 30 19:54:06 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: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version: 4.7.2
Severity: normal | Keywords:
Focuses: |
---------------------------+-----------------------------
== What's Happening: ==
If a child theme of Twenty Seventeen has a `front-page.php` file, and the
Reading settings are set to have "Your Latest Posts" as the front page,
Twenty Seventeen's `twentyseventeen_front_page_template()` function,
called on the `frontpage_template` filter, sets the template to an empty
string instead of the child theme's `front-page.php`, so `index.php` gets
used.
== What I expect: ==
I expect the child theme's `front-page.php` to be used if present, no
matter what the Reading settings are for the front page, as
[https://developer.wordpress.org/themes/basics/template-hierarchy/#front-
page-display described in the codex]. This is the default behaviour.
== Relevant Code: ==
Here's TwentySeventeen's `twentyseventeen_front_page_template()` function,
for reference:
{{{
/**
* Use front-page.php when Front page displays is set to a static page.
*
* @since Twenty Seventeen 1.0
*
* @param string $template front-page.php.
*
* @return string The template to be used: blank if is_home() is true
(defaults to index.php), else $template.
*/
function twentyseventeen_front_page_template( $template ) {
return is_home() ? '' : $template;
}
add_filter( 'frontpage_template', 'twentyseventeen_front_page_template'
);
}}}
Link to [https://core.trac.wordpress.org/browser/trunk/src/wp-
content/themes/twentyseventeen/functions.php?rev=40024#L530 location in
code viewer].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39740>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list