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.
Using Custom Post Type Archives Anywhere
- Load template on all Single Pages In WordPress
- Override WooCommerce archive-product.php Template File In Genesis
- Use Portfolio Grid Style CPT Archive Page Layout On Any Archive Page
Was this helpful?
Thanks for your feedback!

Leave a Reply