Using the template_include function included in WordPress, paste this code in your child themes functions.php file and modify accordingly.
add_filter( 'template_include', 'front_page_landing_template', 99 );
function front_page_landing_template( $template ) {
if ( is_front_page() ) {
$new_template = locate_template( array( 'page_landing.php' ) );
if ( '' != $new_template ) {
return $new_template ;
}
}
return $template;
}
The function only works with page templates and doesn’t work for archive or other template files.
Was This Tutorial Helpful?