This commit is contained in:
2026-04-12 17:36:34 +03:00
parent 310791eb7f
commit fdb7c758c6
6 changed files with 533 additions and 20 deletions

View File

@@ -1,33 +1,103 @@
<?php
/**
* The template for displaying all single posts
*
* The template for displaying single posts.
*
* @package Twenty_Twenty_Four
*/
get_header(); ?>
if ( ! is_singular( 'post' ) ) {
get_header();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/content', 'single' );
the_post_navigation();
<?php
while ( have_posts() ) : the_post();
if ( comments_open() || get_comments_number() ) {
comments_template();
}
endwhile;
?>
</main>
</div>
<?php
get_sidebar();
get_footer();
return;
}
get_template_part( 'template-parts/content', 'single' );
$posts_page_id = (int) get_option( 'page_for_posts' );
$blog_url = $posts_page_id > 0 ? get_permalink( $posts_page_id ) : home_url( '/blog/' );
$test1_header_action_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' );
$test1_header_mode = 'link';
the_post_navigation();
if ( ! $blog_url ) {
$blog_url = home_url( '/blog/' );
}
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
$test1_header_action_label = __( 'Корзина', 'twentytwentyfour' );
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>
<body <?php body_class( 'test1-shared-shell test1-shared-blog-single-page' ); ?>>
<?php wp_body_open(); ?>
<?php require get_theme_file_path( 'template-parts/test1-shared-header.php' ); ?>
endwhile; // End of the loop.
?>
<main class="site-main" role="main">
<div class="container">
<?php
while ( have_posts() ) :
the_post();
?>
<article <?php post_class( 'blog-single' ); ?>>
<div class="blog-single-head reveal">
<a class="blog-back-link" href="<?php echo esc_url( $blog_url ); ?>"><?php esc_html_e( 'Все статьи', 'twentytwentyfour' ); ?></a>
<h1 class="blog-single-title"><?php the_title(); ?></h1>
<div class="blog-meta blog-single-meta">
<time datetime="<?php echo esc_attr( get_the_date( DATE_W3C ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time>
<span><?php echo esc_html( get_the_author() ); ?></span>
<?php
$categories = get_the_category();
if ( ! empty( $categories ) ) :
?>
<span><?php echo esc_html( $categories[0]->name ); ?></span>
<?php endif; ?>
</div>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<?php if ( has_post_thumbnail() ) : ?>
<div class="blog-single-media reveal reveal-delay-1"><?php the_post_thumbnail( 'full', array( 'loading' => 'eager' ) ); ?></div>
<?php endif; ?>
<?php
get_sidebar();
get_footer();
<div class="blog-single-content reveal reveal-delay-1">
<?php the_content(); ?>
</div>
</article>
<div class="blog-single-pagination reveal reveal-delay-2">
<?php
the_post_navigation(
array(
'prev_text' => '<span class="nav-subtitle">' . esc_html__( 'Предыдущая статья', 'twentytwentyfour' ) . '</span><span class="nav-title">%title</span>',
'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Следующая статья', 'twentytwentyfour' ) . '</span><span class="nav-title">%title</span>',
)
);
?>
</div>
<?php
endwhile;
?>
</div>
</main>
<?php require get_theme_file_path( 'template-parts/test1-shared-footer.php' ); ?>
<?php wp_footer(); ?>
</body>
</html>