From 7b24f58aeb421c5d0cf938bd390fcb6f288e3732 Mon Sep 17 00:00:00 2001 From: "Anton.AE" Date: Sat, 18 Apr 2026 20:18:31 +0300 Subject: [PATCH] refactor --- .../themes/twentytwentyfour/archive.php | 13 +- .../themes/twentytwentyfour/footer-test1.php | 12 + .../themes/twentytwentyfour/header-test1.php | 38 +++ wp-content/themes/twentytwentyfour/home.php | 26 +- .../themes/twentytwentyfour/page-cart.php | 30 +-- .../themes/twentytwentyfour/page-checkout.php | 30 +-- .../themes/twentytwentyfour/page-contacts.php | 30 +-- .../themes/twentytwentyfour/page-delivery.php | 30 +-- .../themes/twentytwentyfour/page-faq.php | 30 +-- .../themes/twentytwentyfour/page-service.php | 30 +-- .../themes/twentytwentyfour/page-shop.php | 30 +-- .../themes/twentytwentyfour/page-test1.php | 252 ++---------------- wp-content/themes/twentytwentyfour/single.php | 26 +- 13 files changed, 178 insertions(+), 399 deletions(-) create mode 100644 wp-content/themes/twentytwentyfour/footer-test1.php create mode 100644 wp-content/themes/twentytwentyfour/header-test1.php diff --git a/wp-content/themes/twentytwentyfour/archive.php b/wp-content/themes/twentytwentyfour/archive.php index e43e87a0..f87861e2 100644 --- a/wp-content/themes/twentytwentyfour/archive.php +++ b/wp-content/themes/twentytwentyfour/archive.php @@ -6,7 +6,16 @@ * @package Twenty_Twenty_Four */ -get_header(); ?> + +$test1_header_args = array( + 'body_class' => 'test1-shared-shell test1-shared-blog-page', + 'header_action_url' => function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' ), + 'header_action_label' => __( 'Корзина', 'twentytwentyfour' ), + 'header_mode' => 'link', +); + +get_header( 'test1', $test1_header_args ); +?> + + diff --git a/wp-content/themes/twentytwentyfour/header-test1.php b/wp-content/themes/twentytwentyfour/header-test1.php new file mode 100644 index 00000000..b1cde841 --- /dev/null +++ b/wp-content/themes/twentytwentyfour/header-test1.php @@ -0,0 +1,38 @@ + 'test1-landing-page', + 'header_mode' => 'cart', + 'header_action_url' => '', + 'header_action_label' => '', + ) +); + +$body_class = $args['body_class']; + +if ( is_string( $body_class ) ) { + $body_class = trim( $body_class ); +} + +?> +> + + + + + +> + + diff --git a/wp-content/themes/twentytwentyfour/home.php b/wp-content/themes/twentytwentyfour/home.php index 3b6e49b8..1d8f6875 100644 --- a/wp-content/themes/twentytwentyfour/home.php +++ b/wp-content/themes/twentytwentyfour/home.php @@ -16,16 +16,16 @@ if ( '' === trim( wp_strip_all_tags( $blog_intro ) ) ) { $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'; -?> -> - - - - - -> - - + +$test1_header_args = array( + 'body_class' => 'test1-shared-shell test1-shared-blog-page', + 'header_action_url' => $test1_header_action_url, + 'header_action_label' => $test1_header_action_label, + 'header_mode' => $test1_header_mode, +); + +get_header( 'test1', $test1_header_args ); +?>
@@ -100,7 +100,5 @@ $test1_header_mode = 'link';
- - - - + -> - - - - - -> - - +$test1_header_args = array( + 'body_class' => 'test1-shared-shell test1-shared-cart-page', + 'header_action_url' => function_exists( 'wc_get_checkout_url' ) ? wc_get_checkout_url() : '', + 'header_action_label' => __( 'Оформление', 'twentytwentyfour' ), + 'header_mode' => 'link', +); + +get_header( 'test1', $test1_header_args ); +?>
@@ -32,7 +26,5 @@
- - - - + -> - - - - - -> - - +$test1_header_args = array( + 'body_class' => 'test1-shared-shell test1-shared-checkout-page', + 'header_action_url' => function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : '', + 'header_action_label' => __( 'Корзина', 'twentytwentyfour' ), + 'header_mode' => 'link', +); + +get_header( 'test1', $test1_header_args ); +?>
@@ -32,7 +26,5 @@
- - - - + -> - - - - - -> - - +$test1_header_args = array( + 'body_class' => 'test1-shared-shell test1-shared-contacts-page', + 'header_action_url' => function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' ), + 'header_action_label' => __( 'Корзина', 'twentytwentyfour' ), + 'header_mode' => 'link', +); + +get_header( 'test1', $test1_header_args ); +?>
@@ -82,7 +76,5 @@
- - - - + -> - - - - - -> - - +$test1_header_args = array( + 'body_class' => 'test1-shared-shell test1-shared-delivery-page', + 'header_action_url' => function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' ), + 'header_action_label' => __( 'Корзина', 'twentytwentyfour' ), + 'header_mode' => 'link', +); + +get_header( 'test1', $test1_header_args ); +?>
@@ -129,7 +123,5 @@
- - - - + -> - - - - - -> - - +$test1_header_args = array( + 'body_class' => 'test1-shared-shell test1-shared-faq-page', + 'header_action_url' => function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' ), + 'header_action_label' => __( 'Корзина', 'twentytwentyfour' ), + 'header_mode' => 'link', +); + +get_header( 'test1', $test1_header_args ); +?>
@@ -101,7 +95,5 @@
- - - - + -> - - - - - -> - - +$test1_header_args = array( + 'body_class' => 'test1-shared-shell test1-shared-service-page', + 'header_action_url' => function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' ), + 'header_action_label' => __( 'Корзина', 'twentytwentyfour' ), + 'header_mode' => 'link', +); + +get_header( 'test1', $test1_header_args ); +?>
@@ -99,7 +93,5 @@
- - - - + -> - - - - - -> - - +$test1_header_args = array( + 'body_class' => 'test1-shared-shell test1-shared-shop-page', + 'header_action_url' => function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' ), + 'header_action_label' => __( 'Корзина', 'twentytwentyfour' ), + 'header_mode' => 'link', +); + +get_header( 'test1', $test1_header_args ); +?>
@@ -27,7 +21,5 @@
- - - - + - - - - - Доставка питьевой воды в Севастополе — 19 л для дома и офиса - - - - - - - - - - - - - -
+get_header( 'test1' ); +?> +
@@ -242,7 +166,14 @@ $landing_html = <<<'HTML' Можно заказать разово или подключить регулярную доставку, чтобы не следить за остатками.

-
+ +

Вода 19 литров

@@ -303,6 +234,9 @@ $landing_html = <<<'HTML'
+
@@ -753,47 +687,6 @@ $landing_html = <<<'HTML'
- -