My front-page.php
works fine in the WordPress root folder. But I would like to put it in the page-templates subfolder.
How do I make it load from there?
My front-page.php
works fine in the WordPress root folder. But I would like to put it in the page-templates subfolder.
How do I make it load from there?
You can make use of the frontpage_template
filter to adjust where your template should be loaded from
add_filter( 'frontpage_template', function ( $template )
{
$locate_template = locate_template( 'page-templates/front-page.php' );
if ( !$locate_template )
return $template;
return $locate_template;
});