From eef436b53cc301c21f27ea5191fdc0f57282a499 Mon Sep 17 00:00:00 2001 From: Dekart Deploy Bot Date: Wed, 22 Jul 2026 19:18:10 +0000 Subject: [PATCH] Global 2026-07-22 --- wp-content/themes/dekart/front-page.php | 5 -- wp-content/themes/dekart/functions.php | 39 +++++++++++++++ .../dekart/template-parts/hero-front.php | 47 ++----------------- 3 files changed, 42 insertions(+), 49 deletions(-) diff --git a/wp-content/themes/dekart/front-page.php b/wp-content/themes/dekart/front-page.php index abdd6be..85675de 100644 --- a/wp-content/themes/dekart/front-page.php +++ b/wp-content/themes/dekart/front-page.php @@ -6,11 +6,6 @@ Template Name: шаблон главной страницы get_header(); $post_id = get_the_ID(); -// ─── УЧЕБНЫЙ ГОД ─── -$current_year = (int) date( 'Y' ); -$next_year = $current_year + 1; -$school_year = $current_year . '/' . $next_year; - // ─── ДАННЫЕ ФИЛИАЛА ─── $branch_email = get_option( 'branch_email' ) ?: carbon_get_theme_option( 'site_mail' ) ?: ''; $branch_phone = get_option( 'branch_phone' ) ?: carbon_get_theme_option( 'site_phone' ) ?: ''; diff --git a/wp-content/themes/dekart/functions.php b/wp-content/themes/dekart/functions.php index 11c928a..9e45b73 100644 --- a/wp-content/themes/dekart/functions.php +++ b/wp-content/themes/dekart/functions.php @@ -4,6 +4,45 @@ require_once get_template_directory() . '/inc/template-tags.php'; // Pksh_Data — централизованная загрузка данных для page-podgotovka-k-shkole.php require_once get_template_directory() . '/inc/class-pksh-data.php'; +// ─── Carbon Fields helper (безопасный вызов с fallback) ─── +if ( ! function_exists( 'crb_get_theme_option' ) ) { + function crb_get_theme_option( string $key, $default = '' ) { + return function_exists( 'carbon_get_theme_option' ) + ? carbon_get_theme_option( $key ) ?: $default + : $default; + } +} +if ( ! function_exists( 'crb_get_post_meta' ) ) { + function crb_get_post_meta( int $post_id, string $key, $default = '' ) { + return function_exists( 'carbon_get_post_meta' ) + ? carbon_get_post_meta( $post_id, $key ) ?: $default + : $default; + } +} + +// ─── CRO-трекинг для data-track кнопок на hero (hero-front.php) ─── +add_action( 'wp_footer', function () { + if ( wp_script_is( 'front-page-script', 'enqueued' ) ) { + wp_add_inline_script( 'front-page-script', ' +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll("[data-track]").forEach(function(el) { + el.addEventListener("click", function() { + if (typeof gtag === "function") { + gtag("event", "hero_click", { + "event_category": "engagement", + "event_label": this.dataset.track + }); + } + if (typeof ym === "function") { + ym(' . ( defined( 'YM_COUNTER_ID' ) ? esc_js( YM_COUNTER_ID ) : 'null' ) . ', "reachGoal", this.dataset.track); + } + }); + }); +}); +' ); + } +}, 100 ); + /** * Замена названия сайта из Настроек филиала. * blogname (Внешний вид → Настроить → Свойства сайта) берётся из branch_name. diff --git a/wp-content/themes/dekart/template-parts/hero-front.php b/wp-content/themes/dekart/template-parts/hero-front.php index 2c0af55..d927ae1 100644 --- a/wp-content/themes/dekart/template-parts/hero-front.php +++ b/wp-content/themes/dekart/template-parts/hero-front.php @@ -11,23 +11,6 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } -// ─── ВСПОМОГАТЕЛЬНАЯ ФУНКЦИЯ — Carbon Fields с проверкой ─── -if ( ! function_exists( 'crb_get_theme_option' ) ) { - function crb_get_theme_option( string $key, $default = '' ) { - return function_exists( 'carbon_get_theme_option' ) - ? carbon_get_theme_option( $key ) ?: $default - : $default; - } -} - -if ( ! function_exists( 'crb_get_post_meta' ) ) { - function crb_get_post_meta( int $post_id, string $key, $default = '' ) { - return function_exists( 'carbon_get_post_meta' ) - ? carbon_get_post_meta( $post_id, $key ) ?: $default - : $default; - } -} - // ─── ДАННЫЕ ФИЛИАЛА ─── $branch_phone = get_option( 'branch_phone' ) ?: crb_get_theme_option( 'site_phone' ); $branch_city = get_option( 'branch_city' ) ?: crb_get_theme_option( 'site_city', 'Щёлково' ); @@ -64,7 +47,7 @@ if ( empty( $hero_stats ) || ! is_array( $hero_stats ) ) { ]; } -// ─── ЗВЁЗДЫ (SVG один раз) ─── +// ─── ЗВЁЗДЫ ─── $star_svg = ''; // ─── ПЛАШКИ (float-блоки) ─── @@ -89,7 +72,7 @@ $phone_clean = $branch_phone ? preg_replace( '/[\s\-\–\(\)]/', '', $branch_pho -

+

Небольшие классы до 12 человек, опытные педагоги и английский с 1 класса. Первая смена + продлёнка до 18:00. Приходите посмотреть школу и познакомиться с учителем. Открыт набор на год.

@@ -111,7 +94,7 @@ $phone_clean = $branch_phone ? preg_replace( '/[\s\-\–\(\)]/', '', $branch_pho
4.9 из 5 на основе 190 отзывов на внешних площадках @@ -156,27 +139,3 @@ $phone_clean = $branch_phone ? preg_replace( '/[\s\-\–\(\)]/', '', $branch_pho
- -