fix blog
This commit is contained in:
BIN
2026-04-12_17-40-45.png
Normal file
BIN
2026-04-12_17-40-45.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
@@ -399,6 +399,52 @@ function twentytwentyfour_shop_template( $template ) {
|
|||||||
}
|
}
|
||||||
add_filter( 'template_include', 'twentytwentyfour_shop_template', 20 );
|
add_filter( 'template_include', 'twentytwentyfour_shop_template', 20 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use a standalone PHP template for the posts page (/blog).
|
||||||
|
*
|
||||||
|
* @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', 30 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use a standalone PHP template for single blog posts.
|
||||||
|
*
|
||||||
|
* @since Twenty Twenty-Four 1.0
|
||||||
|
*
|
||||||
|
* @param string $template Resolved template path.
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function twentytwentyfour_blog_single_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_blog_single_template', 30 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enqueue standalone landing assets for the page slug "test1".
|
* Enqueue standalone landing assets for the page slug "test1".
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user