From 9f141d94ca6dc56a1eba98fb7639e48ff73a4077 Mon Sep 17 00:00:00 2001 From: "Anton.AE" Date: Mon, 13 Apr 2026 21:56:32 +0300 Subject: [PATCH] fix blog --- .../themes/twentytwentyfour/functions.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/wp-content/themes/twentytwentyfour/functions.php b/wp-content/themes/twentytwentyfour/functions.php index 0eaff36d..2b7693a8 100644 --- a/wp-content/themes/twentytwentyfour/functions.php +++ b/wp-content/themes/twentytwentyfour/functions.php @@ -422,6 +422,29 @@ function twentytwentyfour_blog_home_template( $template ) { } add_filter( 'template_include', 'twentytwentyfour_blog_home_template', 25 ); +/** + * Force the custom single post template. + * + * @since Twenty Twenty-Four 1.0 + * + * @param string $template Resolved template path. + * @return string + */ +function twentytwentyfour_single_post_template( $template ) { + if ( ! is_singular( 'post' ) ) { + return $template; + } + + $custom_template = get_theme_file_path( 'single.php' ); + + if ( file_exists( $custom_template ) ) { + return $custom_template; + } + + return $template; +} +add_filter( 'template_include', 'twentytwentyfour_single_post_template', 25 ); + /** * Enqueue standalone landing assets for the page slug "test1". *