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

@@ -158,6 +158,10 @@
color: #08338d;
}
.test1-shared-shell .nav a.is-active {
color: #08338d;
}
.test1-shared-shell .header-actions {
display: flex;
align-items: center;
@@ -256,6 +260,302 @@
font-size: 13px;
}
.test1-shared-blog-page,
.test1-shared-blog-single-page {
min-height: 100vh;
display: flex;
flex-direction: column;
}
.test1-shared-blog-page .site-main,
.test1-shared-blog-single-page .site-main {
flex: 1 0 auto;
padding-bottom: 30px;
}
.test1-shared-blog-page .classic-footer,
.test1-shared-blog-single-page .classic-footer {
margin-top: auto;
}
.test1-shared-shell .blog-hero .section-head {
margin-bottom: 12px;
}
.test1-shared-shell .blog-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 24px;
}
.test1-shared-shell .blog-card {
display: flex;
flex-direction: column;
min-height: 100%;
border: 1px solid rgba(18, 48, 89, 0.1);
border-radius: 22px;
background: rgba(255, 255, 255, 0.86);
box-shadow: 0 18px 40px rgba(13, 79, 214, 0.1);
overflow: hidden;
transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.test1-shared-shell .blog-card:hover {
transform: translateY(-6px);
box-shadow: 0 24px 48px rgba(13, 79, 214, 0.16);
border-color: rgba(13, 79, 214, 0.26);
}
.test1-shared-shell .blog-card-media {
display: block;
position: relative;
aspect-ratio: 16 / 10;
overflow: hidden;
background: linear-gradient(135deg, #0d4fd6, #3cc8ff);
}
.test1-shared-shell .blog-card-media img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.35s ease;
}
.test1-shared-shell .blog-card:hover .blog-card-media img {
transform: scale(1.04);
}
.test1-shared-shell .blog-card-placeholder {
position: absolute;
inset: 0;
display: grid;
place-items: center;
color: rgba(255, 255, 255, 0.92);
font-size: 46px;
font-weight: 800;
letter-spacing: 0.06em;
text-transform: uppercase;
}
.test1-shared-shell .blog-card-body {
display: grid;
gap: 12px;
padding: 18px 18px 20px;
}
.test1-shared-shell .blog-meta {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
color: #5f7496;
font-size: 13px;
font-weight: 700;
}
.test1-shared-shell .blog-meta span {
display: inline-flex;
align-items: center;
gap: 6px;
}
.test1-shared-shell .blog-meta span::before {
content: "";
width: 4px;
height: 4px;
border-radius: 50%;
background: rgba(95, 116, 150, 0.58);
}
.test1-shared-shell .blog-card-title {
margin: 0;
font-size: clamp(20px, 2.1vw, 27px);
line-height: 1.15;
letter-spacing: -0.02em;
}
.test1-shared-shell .blog-card-title a {
text-decoration: none;
color: #123059;
}
.test1-shared-shell .blog-card-excerpt {
margin: 0;
color: #5f7496;
line-height: 1.65;
}
.test1-shared-shell .blog-card-link {
justify-self: start;
}
.test1-shared-shell .blog-empty-state {
padding: 38px;
border-radius: 22px;
border: 1px solid rgba(18, 48, 89, 0.1);
background: rgba(255, 255, 255, 0.88);
}
.test1-shared-shell .blog-empty-state h2 {
margin: 0;
font-size: clamp(28px, 4vw, 42px);
}
.test1-shared-shell .blog-empty-state p {
margin: 14px 0 0;
color: #5f7496;
}
.test1-shared-shell .navigation.pagination {
margin-top: 28px;
}
.test1-shared-shell .navigation.pagination .nav-links {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.test1-shared-shell .navigation.pagination .page-numbers {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 44px;
min-height: 44px;
padding: 8px 12px;
border-radius: 14px;
border: 1px solid rgba(18, 48, 89, 0.14);
background: rgba(255, 255, 255, 0.82);
color: #123059;
text-decoration: none;
font-weight: 800;
}
.test1-shared-shell .navigation.pagination .page-numbers.current {
border-color: rgba(13, 79, 214, 0.35);
background: linear-gradient(135deg, rgba(13, 79, 214, 0.18), rgba(60, 200, 255, 0.2));
}
.test1-shared-shell .blog-single {
display: grid;
gap: 22px;
}
.test1-shared-shell .blog-single-head {
margin-top: 10px;
padding: 26px;
border-radius: 24px;
border: 1px solid rgba(18, 48, 89, 0.1);
background: rgba(255, 255, 255, 0.84);
box-shadow: 0 18px 36px rgba(13, 79, 214, 0.08);
}
.test1-shared-shell .blog-back-link {
display: inline-flex;
align-items: center;
gap: 8px;
margin-bottom: 14px;
font-weight: 800;
color: #08338d;
text-decoration: none;
}
.test1-shared-shell .blog-back-link::before {
content: "\2190";
}
.test1-shared-shell .blog-single-title {
margin: 0;
font-size: clamp(34px, 5vw, 62px);
line-height: 1.02;
letter-spacing: -0.03em;
}
.test1-shared-shell .blog-single-meta {
margin-top: 14px;
}
.test1-shared-shell .blog-single-media {
border-radius: 24px;
overflow: hidden;
box-shadow: 0 24px 48px rgba(13, 79, 214, 0.15);
}
.test1-shared-shell .blog-single-media img {
width: 100%;
height: auto;
display: block;
}
.test1-shared-shell .blog-single-content {
padding: 26px;
border-radius: 24px;
border: 1px solid rgba(18, 48, 89, 0.1);
background: rgba(255, 255, 255, 0.88);
color: #183764;
line-height: 1.78;
}
.test1-shared-shell .blog-single-content h2,
.test1-shared-shell .blog-single-content h3,
.test1-shared-shell .blog-single-content h4 {
color: #0b2f75;
line-height: 1.2;
}
.test1-shared-shell .blog-single-content h2 {
margin-top: 28px;
margin-bottom: 12px;
font-size: clamp(28px, 3.4vw, 42px);
}
.test1-shared-shell .blog-single-content p {
margin: 0 0 16px;
}
.test1-shared-shell .blog-single-content ul,
.test1-shared-shell .blog-single-content ol {
margin: 0 0 16px;
padding-left: 22px;
}
.test1-shared-shell .blog-single-pagination {
padding: 20px 0 4px;
}
.test1-shared-shell .blog-single-pagination .nav-links {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 14px;
}
.test1-shared-shell .blog-single-pagination .nav-previous a,
.test1-shared-shell .blog-single-pagination .nav-next a {
display: grid;
gap: 4px;
padding: 16px;
border-radius: 18px;
border: 1px solid rgba(18, 48, 89, 0.12);
background: rgba(255, 255, 255, 0.86);
text-decoration: none;
color: #123059;
min-height: 100%;
}
.test1-shared-shell .blog-single-pagination .nav-subtitle {
color: #5f7496;
font-size: 12px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.test1-shared-shell .blog-single-pagination .nav-title {
font-weight: 800;
line-height: 1.35;
}
@media (max-width: 960px) {
.test1-shared-shell .nav {
display: none;
@@ -272,6 +572,14 @@
.test1-shared-shell .classic-footer-main .brand-col {
grid-column: 1 / -1;
}
.test1-shared-shell .blog-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.test1-shared-shell .blog-single-pagination .nav-links {
grid-template-columns: 1fr;
}
}
@media (max-width: 700px) {
@@ -306,4 +614,15 @@
.test1-shared-shell .classic-footer-main .brand-col {
grid-column: auto;
}
.test1-shared-shell .blog-grid {
grid-template-columns: 1fr;
gap: 18px;
}
.test1-shared-shell .blog-single-head,
.test1-shared-shell .blog-single-content {
padding: 18px;
border-radius: 18px;
}
}

View File

@@ -406,7 +406,7 @@ add_filter( 'template_include', 'twentytwentyfour_shop_template', 20 );
* @return void
*/
function twentytwentyfour_test1_assets() {
$use_test1_assets = is_front_page() || is_page( array( 'test1', 'faq', 'contacts', 'delivery', 'service' ) );
$use_test1_assets = is_front_page() || is_home() || is_singular( 'post' ) || is_page( array( 'test1', 'faq', 'contacts', 'delivery', 'service' ) );
if ( ! $use_test1_assets ) {
return;
@@ -498,7 +498,7 @@ add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 );
* @return void
*/
function twentytwentyfour_test1_shared_shell_assets() {
if ( ! ( ( function_exists( 'is_checkout' ) && is_checkout() && ! is_order_received_page() ) || ( function_exists( 'is_cart' ) && is_cart() ) || ( function_exists( 'is_shop' ) && is_shop() ) || is_page( 'faq' ) || is_page( 'contacts' ) || is_page( 'delivery' ) || is_page( 'service' ) ) ) {
if ( ! ( ( function_exists( 'is_checkout' ) && is_checkout() && ! is_order_received_page() ) || ( function_exists( 'is_cart' ) && is_cart() ) || ( function_exists( 'is_shop' ) && is_shop() ) || is_home() || is_singular( 'post' ) || is_page( 'faq' ) || is_page( 'contacts' ) || is_page( 'delivery' ) || is_page( 'service' ) ) ) {
return;
}

View File

@@ -0,0 +1,106 @@
<?php
/**
* Blog posts index template for the posts page.
*
* @package Twenty_Twenty_Four
*/
$posts_page_id = (int) get_option( 'page_for_posts' );
$blog_title = $posts_page_id > 0 ? get_the_title( $posts_page_id ) : __( 'Блог', 'twentytwentyfour' );
$blog_intro = $posts_page_id > 0 ? get_post_field( 'post_excerpt', $posts_page_id ) : '';
if ( '' === trim( wp_strip_all_tags( $blog_intro ) ) ) {
$blog_intro = __( 'Пишем о качестве воды, правильном хранении, доставке домой и в офис, а также делимся практическими советами для ежедневного потребления.', 'twentytwentyfour' );
}
$test1_header_action_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' );
$test1_header_action_label = __( 'Корзина', 'twentytwentyfour' );
$test1_header_mode = 'link';
?><!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-page' ); ?>>
<?php wp_body_open(); ?>
<?php require get_theme_file_path( 'template-parts/test1-shared-header.php' ); ?>
<main class="site-main" role="main">
<section class="section blog-hero" aria-labelledby="blog-page-title">
<div class="container">
<div class="section-head">
<div>
<span class="eyebrow"><?php esc_html_e( 'Редакция АкваЛиния', 'twentytwentyfour' ); ?></span>
<h1 class="section-title" id="blog-page-title"><?php echo esc_html( $blog_title ); ?></h1>
</div>
<p class="section-copy"><?php echo esc_html( $blog_intro ); ?></p>
</div>
</div>
</section>
<section class="section blog-stream" aria-label="Список статей блога">
<div class="container">
<?php if ( have_posts() ) : ?>
<div class="blog-grid">
<?php
$article_index = 0;
while ( have_posts() ) :
the_post();
$delay_class = $article_index < 5 ? ' reveal-delay-' . $article_index : '';
++$article_index;
?>
<article <?php post_class( 'blog-card reveal' . $delay_class ); ?>>
<a class="blog-card-media" href="<?php the_permalink(); ?>" aria-label="<?php echo esc_attr( wp_strip_all_tags( get_the_title() ) ); ?>">
<?php if ( has_post_thumbnail() ) : ?>
<?php the_post_thumbnail( 'large', array( 'loading' => 'lazy' ) ); ?>
<?php else : ?>
<?php
$initial = function_exists( 'mb_substr' ) ? mb_substr( get_the_title(), 0, 1 ) : substr( get_the_title(), 0, 1 );
$initial = function_exists( 'mb_strtoupper' ) ? mb_strtoupper( $initial ) : strtoupper( $initial );
?>
<span class="blog-card-placeholder"><?php echo esc_html( $initial ); ?></span>
<?php endif; ?>
</a>
<div class="blog-card-body">
<div class="blog-meta">
<time datetime="<?php echo esc_attr( get_the_date( DATE_W3C ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time>
<?php
$categories = get_the_category();
if ( ! empty( $categories ) ) :
?>
<span><?php echo esc_html( $categories[0]->name ); ?></span>
<?php endif; ?>
</div>
<h2 class="blog-card-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p class="blog-card-excerpt"><?php echo esc_html( wp_trim_words( wp_strip_all_tags( get_the_excerpt() ), 24, '...' ) ); ?></p>
<a class="ghost-button blog-card-link" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Читать статью', 'twentytwentyfour' ); ?></a>
</div>
</article>
<?php endwhile; ?>
</div>
<?php
the_posts_pagination(
array(
'prev_text' => __( 'Назад', 'twentytwentyfour' ),
'next_text' => __( 'Вперед', 'twentytwentyfour' ),
'before_page_number' => '<span class="screen-reader-text">' . __( 'Страница', 'twentytwentyfour' ) . ' </span>',
)
);
?>
<?php else : ?>
<div class="blog-empty-state">
<h2><?php esc_html_e( 'Пока нет статей', 'twentytwentyfour' ); ?></h2>
<p><?php esc_html_e( 'Добавьте первую запись в разделе Записи, и она сразу появится на странице блога.', 'twentytwentyfour' ); ?></p>
</div>
<?php endif; ?>
</div>
</section>
</main>
<?php require get_theme_file_path( 'template-parts/test1-shared-footer.php' ); ?>
<?php wp_footer(); ?>
</body>
</html>

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>

View File

@@ -5,6 +5,13 @@
* @package Twenty_Twenty_Four
*/
$posts_page_id = (int) get_option( 'page_for_posts' );
$blog_url = $posts_page_id > 0 ? get_permalink( $posts_page_id ) : home_url( '/blog/' );
if ( ! $blog_url ) {
$blog_url = home_url( '/blog/' );
}
?>
<footer class="footer premium-footer classic-footer">
<div class="container classic-footer-shell">
@@ -28,6 +35,7 @@
<h3>Навигация</h3>
<div class="footer-links">
<a href="<?php echo esc_url( home_url( '/#catalog' ) ); ?>">Каталог</a>
<a href="<?php echo esc_url( $blog_url ); ?>">Блог</a>
<a href="<?php echo esc_url( home_url( '/delivery/' ) ); ?>">Доставка воды в Севастополе</a>
<a href="<?php echo esc_url( home_url( '/service/' ) ); ?>">Доставка воды в офис</a>
<a href="<?php echo esc_url( home_url( '/faq/' ) ); ?>">Частые вопросы</a>

View File

@@ -8,6 +8,14 @@
$test1_header_action_url = isset( $test1_header_action_url ) ? $test1_header_action_url : '';
$test1_header_action_label = isset( $test1_header_action_label ) ? $test1_header_action_label : '';
$test1_header_mode = isset( $test1_header_mode ) ? $test1_header_mode : 'link';
$posts_page_id = (int) get_option( 'page_for_posts' );
$blog_url = $posts_page_id > 0 ? get_permalink( $posts_page_id ) : home_url( '/blog/' );
if ( ! $blog_url ) {
$blog_url = home_url( '/blog/' );
}
$blog_is_active = is_home() || is_singular( 'post' ) || is_category() || is_tag() || is_author() || is_date();
?>
<header class="site-header">
<div class="container">
@@ -26,6 +34,7 @@ $test1_header_mode = isset( $test1_header_mode ) ? $test1_header_mode :
<nav class="nav" aria-label="Основная навигация">
<a href="<?php echo esc_url( home_url( '/shop/' ) ); ?>">Каталог</a>
<a class="<?php echo esc_attr( $blog_is_active ? 'is-active' : '' ); ?>" href="<?php echo esc_url( $blog_url ); ?>">Блог</a>
<a href="<?php echo esc_url( home_url( '/delivery/' ) ); ?>">Доставка</a>
<a href="<?php echo esc_url( home_url( '/service/' ) ); ?>">Для дома и офиса</a>
<a href="<?php echo esc_url( home_url( '/faq/' ) ); ?>">FAQ</a>
@@ -59,6 +68,7 @@ $test1_header_mode = isset( $test1_header_mode ) ? $test1_header_mode :
<div class="mobile-card">
<nav class="mobile-nav" aria-label="Мобильная навигация">
<a href="<?php echo esc_url( home_url( '/#catalog' ) ); ?>">Каталог</a>
<a href="<?php echo esc_url( $blog_url ); ?>">Блог</a>
<a href="<?php echo esc_url( home_url( '/delivery/' ) ); ?>">Условия доставки</a>
<a href="<?php echo esc_url( home_url( '/service/' ) ); ?>">Для дома и офиса</a>
<a href="<?php echo esc_url( home_url( '/faq/' ) ); ?>">FAQ</a>