From a24b83c27d476c74acaa4df54e7001cfb834be27 Mon Sep 17 00:00:00 2001 From: Dekart Deploy Bot Date: Wed, 20 May 2026 00:31:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B8=D0=BA=D1=80=D0=BE=D1=80=D0=B0?= =?UTF-8?q?=D0=B7=D0=BC=D0=B5=D1=82=D0=BA=D0=B0=20=D0=9B=D0=B0=D0=B3=D0=B5?= =?UTF-8?q?=D1=80=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wp-content/themes/dekart/page-camp.php | 89 +++++++++++++++++--------- 1 file changed, 60 insertions(+), 29 deletions(-) diff --git a/wp-content/themes/dekart/page-camp.php b/wp-content/themes/dekart/page-camp.php index a0c33f3..95aabec 100644 --- a/wp-content/themes/dekart/page-camp.php +++ b/wp-content/themes/dekart/page-camp.php @@ -6,6 +6,23 @@ Template Name: Шаблон страницы Лагерь Поля контента страницы (hero, about, programs, mentors, faq, etc.) — в Carbon Fields в метабоксе ниже. */ add_filter( 'wpseo_json_ld_output', '__return_false' ); +add_filter( 'wpseo_opengraph_type', function( $type ) { + if ( is_page_template( 'page-camp.php' ) ) { + return 'website'; + } + return $type; +} ); +add_filter( 'wpseo_frontend_presenter_classes', function( $presenters ) { + if ( is_page_template( 'page-camp.php' ) ) { + $presenters = array_filter( $presenters, function( $p ) { + return strpos( $p, 'Article_Modified_Time' ) === false + && strpos( $p, 'Article_Published_Time' ) === false + && strpos( $p, 'Article_Author' ) === false + && strpos( $p, 'Article_Publisher' ) === false; + } ); + } + return $presenters; +} ); add_action('wp_head', function() { echo ''; }, 100); get_header(); ?> @@ -314,9 +331,9 @@ $metrics = [ -
+
-

Летние программы

+

Летние программы

-
- - - +
Половина дня

Время пребывания — на выбор (до обеда или до вечера)

-
- +
+ за 5 дней -
@@ -404,10 +417,9 @@ $metrics = [

Полный день

Пребывание в клубе с утра до вечера, дополнительные активности

-
- +
+ за 5 дней -
@@ -549,34 +561,29 @@ $metrics = [ if (!$stars) $stars = 5; if (!$text) continue; ?> -
- +
- -
- - - +
-
+
@@ -586,7 +593,7 @@ $metrics = [

Часто задаваемые вопросы

-
+
-
- " . esc_html($questions_question) . " +
+ " . esc_html($questions_question) . " @@ -610,8 +617,8 @@ $metrics = [
-
-
" . wp_kses_post($questions_answer) . "
+
+
" . wp_kses_post($questions_answer) . "
"; if ($count % 2 === 0) { @@ -806,6 +813,7 @@ if ( is_array( $programs ) ) { } $ev = array( '@type' => 'Event', + 'eventStatus' => 'https://schema.org/EventScheduled', 'organizer' => array( '@id' => home_url('/') . '#organization' ), 'location' => array( '@id' => get_permalink( $post_id ) ), ); @@ -817,12 +825,30 @@ if ( is_array( $programs ) ) { } if ( ! empty( $item['programs_date'] ) ) { $raw = wp_strip_all_tags( $item['programs_date'] ); + // ISO: 2025-05-26 if ( preg_match( '/(\d{4})-(\d{2})-(\d{2})/', $raw, $m ) ) { $ev['startDate'] = $m[1] . '-' . $m[2] . '-' . $m[3]; + // DD.MM.YYYY } elseif ( preg_match( '/(\d{2})\.(\d{2})\.(\d{4})/', $raw, $m ) ) { $ev['startDate'] = $m[3] . '-' . $m[2] . '-' . $m[1]; + // Русские месяцы: "26–30 мая 2025" или "30 июня–4 июля 2025" + } elseif ( preg_match( '/(\d{1,2})\s*(?:[–—\-]|\s*–\s*)\d{1,2}\s+([а-яё]+)/ui', $raw, $m ) + || preg_match( '/(\d{1,2})\s+([а-яё]+)\s*[–—\-]/ui', $raw, $m ) + || preg_match( '/(\d{1,2})\s+([а-яё]+)\s+\d{4}/ui', $raw, $m ) ) { + $ru_months = array( + 'января' => '01', 'февраля' => '02', 'марта' => '03', + 'апреля' => '04', 'мая' => '05', 'июня' => '06', + 'июля' => '07', 'августа' => '08', 'сентября' => '09', + 'октября' => '10', 'ноября' => '11', 'декабря' => '12', + ); + $month_name = mb_strtolower( trim( $m[2] ) ); + if ( isset( $ru_months[ $month_name ] ) ) { + preg_match( '/(\d{4})/u', $raw, $y ); + $ev['startDate'] = ( $y[1] ?? date('Y') ) . '-' . $ru_months[ $month_name ] . '-' . str_pad( $m[1], 2, '0', STR_PAD_LEFT ); + } + // Fallback: только год } elseif ( preg_match( '/\d{4}/', $raw, $y ) ) { - $ev['startDate'] = $y[0]; + $ev['startDate'] = $y[0] . '-06-01'; } if ( isset( $ev['description'] ) && $ev['description'] ) { $ev['description'] .= ' — ' . $raw; @@ -951,12 +977,17 @@ $organization = array( 'name' => $jsonld_name, 'url' => home_url('/'), ); +if ( $jsonld_img_url ) { + $organization['logo'] = $jsonld_img_url; +} if ( ! empty( $jsonld_social ) ) { $organization['sameAs'] = $jsonld_social; } +if ( $agg_rating ) { + $localbusiness['aggregateRating'] = $agg_rating; +} $ld_graph = array_merge( array( $localbusiness, $organization ), $ld_events, $ld_faq ); -if ( $agg_rating ) $ld_graph[] = $agg_rating; if ( ! empty( $ld_graph ) ) { $jsonld_data = array(