#39299 closed enhancement (worksforme)
Twenty Seventeen: Allow child themes use Page Template as a front page
| Reported by: | sami.keijonen | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Bundled Theme | Version: | 4.7 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | template |
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.phpalways 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
@
10 years ago
- Resolution → worksforme
- Status new → closed
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Replying to sami.keijonen:
No need for a patch. A child theme (or plugin) just needs one line:
Just make sure that filter is applied on the
after_setup_themeaction (or later).Alternatively, you can create your own function and hook it to the
frontpage_templatefilter to override what Twenty Seventeen is doing.