diff --git a/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css b/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css index b3bc95b7..656d2662 100644 --- a/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css +++ b/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css @@ -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; + } } diff --git a/wp-content/themes/twentytwentyfour/functions.php b/wp-content/themes/twentytwentyfour/functions.php index a9d9c878..4022d1ea 100644 --- a/wp-content/themes/twentytwentyfour/functions.php +++ b/wp-content/themes/twentytwentyfour/functions.php @@ -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; } diff --git a/wp-content/themes/twentytwentyfour/home.php b/wp-content/themes/twentytwentyfour/home.php new file mode 100644 index 00000000..3b6e49b8 --- /dev/null +++ b/wp-content/themes/twentytwentyfour/home.php @@ -0,0 +1,106 @@ + 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'; +?> +> + + + + + +> + + + +
+
+
+
+
+ +

+
+

+
+
+
+ +
+
+ +
+ + + +
+ + __( 'Назад', 'twentytwentyfour' ), + 'next_text' => __( 'Вперед', 'twentytwentyfour' ), + 'before_page_number' => '' . __( 'Страница', 'twentytwentyfour' ) . ' ', + ) + ); + ?> + +
+

+

+
+ +
+
+
+ + + + + diff --git a/wp-content/themes/twentytwentyfour/single.php b/wp-content/themes/twentytwentyfour/single.php index dce12938..5f5c5998 100644 --- a/wp-content/themes/twentytwentyfour/single.php +++ b/wp-content/themes/twentytwentyfour/single.php @@ -1,33 +1,103 @@ +if ( ! is_singular( 'post' ) ) { + get_header(); + ?>
+ +
+
+ 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' ); +?> +> + + + + + +> + + - endwhile; // End of the loop. - ?> +
+
+ +
> +
+ +

+
+ + + + name ); ?> + +
+
-
- + +
'eager' ) ); ?>
+ - + + + + +
+ '' . esc_html__( 'Предыдущая статья', 'twentytwentyfour' ) . '%title', + 'next_text' => '' . esc_html__( 'Следующая статья', 'twentytwentyfour' ) . '%title', + ) + ); + ?> +
+ + + + + + + + diff --git a/wp-content/themes/twentytwentyfour/template-parts/test1-shared-footer.php b/wp-content/themes/twentytwentyfour/template-parts/test1-shared-footer.php index 3739c16f..e53a4093 100644 --- a/wp-content/themes/twentytwentyfour/template-parts/test1-shared-footer.php +++ b/wp-content/themes/twentytwentyfour/template-parts/test1-shared-footer.php @@ -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/' ); +} + ?>