diff --git a/wp-content/themes/twentytwentyfour/functions.php b/wp-content/themes/twentytwentyfour/functions.php index 4022d1ea..0eaff36d 100644 --- a/wp-content/themes/twentytwentyfour/functions.php +++ b/wp-content/themes/twentytwentyfour/functions.php @@ -399,6 +399,29 @@ function twentytwentyfour_shop_template( $template ) { } add_filter( 'template_include', 'twentytwentyfour_shop_template', 20 ); +/** + * Force the custom blog index template for the posts page. + * + * @since Twenty Twenty-Four 1.0 + * + * @param string $template Resolved template path. + * @return string + */ +function twentytwentyfour_blog_home_template( $template ) { + if ( ! is_home() ) { + return $template; + } + + $custom_template = get_theme_file_path( 'home.php' ); + + if ( file_exists( $custom_template ) ) { + return $custom_template; + } + + return $template; +} +add_filter( 'template_include', 'twentytwentyfour_blog_home_template', 25 ); + /** * Enqueue standalone landing assets for the page slug "test1". *