This commit is contained in:
2026-04-13 21:56:32 +03:00
parent 37da9e9644
commit 9f141d94ca

View File

@@ -422,6 +422,29 @@ function twentytwentyfour_blog_home_template( $template ) {
} }
add_filter( 'template_include', 'twentytwentyfour_blog_home_template', 25 ); 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". * Enqueue standalone landing assets for the page slug "test1".
* *