#39299 closed enhancement (worksforme)
Twenty Seventeen: Allow child themes use Page Template as a front page
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7 |
Component: | Bundled Theme | Keywords: | |
Focuses: | template | Cc: |
Description
In Twenty Seventeen we use frontpage_template
filter like this
function twentyseventeen_front_page_template( $template ) { return is_home() ? '' : $template; } add_filter( 'frontpage_template', 'twentyseventeen_front_page_template' );
But this means that child themes can't use Custom Page Template as a front page if they want because front-page.php
would always win over any page templates.
- Create a child theme.
- Create custom page template.
- Try to set that as front page. You can't because
front-page.php
always wins.
In client/custom sites Custom Page Template as front page would be nice to have so that you don't have to override front-page.php
logic.
I'll add patch in a minute.
Attachments (1)
Change History (7)
#1
in reply to:
↑ description
@
8 years ago
- Resolution set to worksforme
- Status changed from new to closed
Version 0, edited 8 years ago
by
(next)
Note: See
TracTickets for help on using
tickets.
Replying to sami.keijonen:
No need for a patch. A child theme (or plugin) just needs one line:
remove_filter( 'frontpage_template', 'twentyseventeen_front_page_template' );
Alternatively, you can create your own function and hook it to the
frontpage_template
filter to override what Twenty Seventeen is doing.