' . "\n";
}
}
}, 1 );
add_action('wp_head', function() { echo ''; }, 100);
get_header();
?>
.camp-city-missing{outline:3px solid red;padding:4px}';
}, 1 );
}
// ─── Универсальные переменные города ───
$city = $opt_city_prep;
$city_clean = $opt_city;
$city_with_prep = $opt_city_prep;
// ─── JSON-LD: ГЕО ───
$jsonld_city = $city_clean;
$jsonld_region = $opt_region;
$jsonld_addr = $opt_address ?: $jsonld_region . ', ' . $city_clean;
$jsonld_coords = $opt_coords;
$jsonld_coord_arr = $jsonld_coords ? array_map( 'trim', explode( ',', $jsonld_coords ) ) : array();
$jsonld_postal_code = $opt_postal;
// ─── JSON-LD: КОНТАКТЫ ───
$jsonld_phone = $opt_phone;
$jsonld_mail = $opt_email;
// ─── JSON-LD: ОРГАНИЗАЦИЯ ───
$jsonld_name = $opt_name;
$jsonld_price_range = $opt_price_range;
// ─── JSON-LD: ЛОГОТИП (ACF option → WP Customizer fallback) ───
if ( $opt_logo && is_array( $opt_logo ) ) {
$jsonld_img_url = $opt_logo['url'] ?? '';
} elseif ( $opt_logo ) {
$jsonld_img_url = wp_get_attachment_url( $opt_logo );
} else {
$jsonld_img_url = '';
}
if ( ! $jsonld_img_url ) {
$logo_id = get_theme_mod( 'custom_logo' );
$jsonld_img_url = $logo_id ? wp_get_attachment_url( $logo_id ) : '';
}
// ─── JSON-LD: СОЦСЕТИ ───
$jsonld_social = array();
if ( is_array( $opt_social_raw ) ) {
foreach ( $opt_social_raw as $s ) {
if ( ! empty( $s['url'] ) ) {
$jsonld_social[] = $s['url'];
}
}
}
// ─── Поля контента страницы (остаются per-page) ───
$priceMin = (int) carbon_get_post_meta( $post_id, 'price_half_day' );
?>
carbon_get_post_meta( $post_id, 'hero_title_h1' ) ?: 'Детский лагерь Декарт.',
'span' => carbon_get_post_meta( $post_id, 'hero_title_span' ) ?: 'Яркое лето без забот!',
'btn_text' => carbon_get_post_meta( $post_id, 'hero_btn_primary' ) ?: 'Записаться на пробный день',
'image_id' => carbon_get_post_meta( $post_id, 'banner_img' ),
];
$metrics = [
[
'img_id' => carbon_get_post_meta( $post_id, 'hero_metric_1_img' ),
'number' => carbon_get_post_meta( $post_id, 'hero_metric_1_number' ) ?: '12',
'label' => carbon_get_post_meta( $post_id, 'hero_metric_1_label' ) ?: 'лет в городе',
'default_icon' => $theme_uri . '/assets/images/doodles/icon-home.png',
],
[
'img_id' => carbon_get_post_meta( $post_id, 'hero_metric_2_img' ),
'number' => carbon_get_post_meta( $post_id, 'hero_metric_2_number' ) ?: '2 500+',
'label' => carbon_get_post_meta( $post_id, 'hero_metric_2_label' ) ?: 'счастливых детей',
'default_icon' => $theme_uri . '/assets/images/doodles/icon-bulb.png',
],
[
'img_id' => carbon_get_post_meta( $post_id, 'hero_metric_3_img' ),
'number' => carbon_get_post_meta( $post_id, 'hero_metric_3_number' ) ?: '4.9 / 5',
'label' => carbon_get_post_meta( $post_id, 'hero_metric_3_label' ) ?: 'рейтинг от родителей',
'default_icon' => $theme_uri . '/assets/images/doodles/icon-award.png',
],
];
?>
'about-us__image',
'loading' => 'lazy',
'alt' => 'Фото детского лагеря Декарт ' . $city_with_prep
] );
else :
echo '
';
endif;
?>
Лето, которое не хочется ставить на паузу
⭐ 2500+ мам доверили нам лето
$item) {
$suggestions_title = $item['suggestions_title'];
$suggestions_text = $item['suggestions_text'];
$icon_file = $icons[$index % count($icons)];
?>
до 10 детей
каждая группа
Приводите ребёнка, когда вам удобно
₽
за 5 дней
с 8:30 до 13:30
утренняя смена
с 13:30 до 18:30
вечерняя смена
- 5 дней пребывания в клубе
- творческие занятия и мастер-классы 1 раз в день
- умные прогулки 1 раз в день
₽
за 5 дней
с 8:30 до 18:30
полный день
- 5 дней пребывания в клубе
- творческие занятия и мастер-классы 2 раза в день
- умные прогулки 2 раза в день
- тематические экскурсии каждую неделю
Наши наставники и ведущие мастер-классов
Наши фотографии
Просмотр фото
Что говорят о нас родители
0) :
$items = array_values($review_items);
$card_idx = 0;
?>
12 ) : ?>
Часто задаваемые вопросы
" . esc_html($questions_question) . "
" . wp_kses_post($questions_answer) . "
";
if ($count % 2 === 0) {
$HTMcol1 .= $accordion_item;
} else {
$HTMcol2 .= $accordion_item;
}
$count++;
}
}
echo "$HTMcol1
";
echo "$HTMcol2
";
?>
Опыт работы в сфере образования:
Дополнительное образование:
'Event',
'eventStatus' => 'https://schema.org/EventScheduled',
'organizer' => array( '@id' => home_url('/') . '#organization' ),
'location' => array( '@id' => get_permalink( $post_id ) ),
);
if ( ! empty( $item['programs_title'] ) ) {
$ev['name'] = wp_strip_all_tags( $item['programs_title'] );
}
if ( ! empty( $item['programs_text'] ) ) {
$ev['description'] = wp_strip_all_tags( $item['programs_text'] );
}
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] . '-06-01';
}
if ( isset( $ev['description'] ) && $ev['description'] ) {
$ev['description'] .= ' — ' . $raw;
} else {
$ev['description'] = $raw;
}
}
if ( ! empty( $item['programs_img'] ) ) {
$ev['image'] = wp_get_attachment_url( $item['programs_img'] );
}
$_half_price = (int)carbon_get_post_meta($post_id, 'price_half_day');
if ( $_half_price > 0 ) {
$ev['offers'] = array(
'@type' => 'Offer',
'price' => $_half_price,
'priceCurrency' => 'RUB',
);
}
if ( $jsonld_img_url && empty( $ev['image'] ) ) {
$ev['image'] = $jsonld_img_url;
}
$ld_events[] = $ev;
}
}
$ld_questions = carbon_get_post_meta( $post_id, 'questions' );
$ld_faq = array();
if ( is_array( $ld_questions ) ) {
$faq_main_entity = array();
foreach ( $ld_questions as $q ) {
$name = ! empty( $q['questions_question'] ) ? wp_strip_all_tags( $q['questions_question'] ) : '';
$answer = ! empty( $q['questions_answer'] ) ? wp_strip_all_tags( $q['questions_answer'] ) : '';
if ( $name && $answer ) {
$faq_main_entity[] = array(
'@type' => 'Question',
'name' => $name,
'acceptedAnswer' => array(
'@type' => 'Answer',
'text' => $answer,
),
);
}
}
if ( ! empty( $faq_main_entity ) ) {
$ld_faq[] = array(
'@type' => 'FAQPage',
'mainEntity' => $faq_main_entity,
);
}
}
$agg_rating = null;
$agg_reviews = new WP_Query( array(
'post_type' => 'reviews',
'posts_per_page' => -1,
'fields' => 'ids',
'suppress_filters' => true,
'meta_query' => array( array(
'key' => 'review_type',
'value' => 'camp',
'compare' => '=',
) ),
) );
if ( $agg_reviews->have_posts() ) {
$total_stars = 0;
$review_cnt = 0;
foreach ( $agg_reviews->posts as $rid ) {
$star = (int) carbon_get_post_meta( $rid, 'review_star' );
if ( $star > 0 ) {
$total_stars += $star;
$review_cnt++;
}
}
if ( $review_cnt > 0 ) {
$agg_rating = array(
'@type' => 'AggregateRating',
'itemReviewed' => array( '@id' => get_permalink( $post_id ) ),
'ratingValue' => round( $total_stars / $review_cnt, 1 ),
'reviewCount' => $review_cnt,
'bestRating' => 5,
'worstRating' => 1,
);
}
}
wp_reset_postdata();
$localbusiness = array(
'@type' => 'LocalBusiness',
'@id' => get_permalink( $post_id ),
'name' => 'Декарт ' . $city_clean,
'alternateName' => array( 'Decart', 'Образовательный центр Декарт' ),
'description' => 'Детский лагерь в ' . $city_clean . ' — образовательный центр Декарт. Летние программы, творчество, развитие.',
'url' => get_permalink( $post_id ),
);
if ( $jsonld_phone ) $localbusiness['telephone'] = $jsonld_phone;
if ( $jsonld_mail ) $localbusiness['email'] = $jsonld_mail;
if ( $jsonld_img_url ) $localbusiness['image'] = $jsonld_img_url;
$localbusiness['address'] = array(
'@type' => 'PostalAddress',
'addressLocality' => $jsonld_city,
'streetAddress' => $jsonld_addr,
'addressRegion' => $jsonld_region,
'addressCountry' => 'RU',
);
if ( $jsonld_postal_code ) {
$localbusiness['address']['postalCode'] = $jsonld_postal_code;
}
if ( ! empty( $jsonld_coord_arr[0] ) && ! empty( $jsonld_coord_arr[1] ) && is_numeric( $jsonld_coord_arr[0] ) && is_numeric( $jsonld_coord_arr[1] ) ) {
$localbusiness['geo'] = array(
'@type' => 'GeoCoordinates',
'latitude' => (float) $jsonld_coord_arr[0],
'longitude' => (float) $jsonld_coord_arr[1],
);
}
$localbusiness['areaServed'] = $city_clean . ', ' . $jsonld_region;
$localbusiness['openingHoursSpecification'] = array(
array(
'@type' => 'OpeningHoursSpecification',
'dayOfWeek' => array( 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday' ),
'opens' => '08:30',
'closes' => '18:30',
),
);
$localbusiness['priceRange'] = $jsonld_price_range;
$localbusiness['parentOrganization'] = array( '@id' => home_url('/') . '#organization' );
$organization = array(
'@type' => 'Organization',
'@id' => home_url('/') . '#organization',
'name' => $jsonld_name,
'url' => home_url('/'),
);
if ( $jsonld_img_url ) {
$organization['logo'] = $jsonld_img_url;
}
if ( ! empty( $jsonld_social ) ) {
$organization['sameAs'] = $jsonld_social;
}
$organization['foundingDate'] = '2020';
if ( $jsonld_phone || $jsonld_mail ) {
$cp = array( '@type' => 'ContactPoint' );
if ( $jsonld_phone ) $cp['telephone'] = $jsonld_phone;
if ( $jsonld_mail ) $cp['email'] = $jsonld_mail;
$cp['contactType'] = 'customer service';
$cp['areaServed'] = 'RU';
$cp['availableLanguage'] = array( 'Russian' );
$organization['contactPoint'] = array( $cp );
}
if ( $agg_rating ) {
$localbusiness['aggregateRating'] = $agg_rating;
}
$ld_website = array(
'@type' => 'WebSite',
'@id' => home_url('/') . '#website',
'url' => home_url('/'),
'name' => $jsonld_name,
'inLanguage' => 'ru-RU',
'publisher' => array( '@id' => home_url('/') . '#organization' ),
'potentialAction' => array(
'@type' => 'SearchAction',
'target' => array(
'@type' => 'EntryPoint',
'urlTemplate' => home_url('/') . '?s={search_term_string}',
),
'query-input' => 'required name=search_term_string',
),
);
$ld_webpage = array(
'@type' => 'WebPage',
'@id' => get_permalink( $post_id ),
'url' => get_permalink( $post_id ),
'inLanguage' => 'ru-RU',
'name' => wp_get_document_title() ?: 'Городской лагерь в ' . $city_clean,
'isPartOf' => array( '@id' => home_url('/') . '#website' ),
'about' => array( '@id' => get_permalink( $post_id ) ),
);
$ld_breadcrumb = array(
'@type' => 'BreadcrumbList',
'@id' => get_permalink( $post_id ) . '#breadcrumb',
'itemListElement' => array(
array(
'@type' => 'ListItem',
'position' => 1,
'name' => 'Главная',
'item' => home_url( '/' ),
),
array(
'@type' => 'ListItem',
'position' => 2,
'name' => 'Городской лагерь в ' . $city_clean,
'item' => get_permalink( $post_id ),
),
),
);
$ld_graph = array_merge( array( $ld_website, $ld_webpage, $ld_breadcrumb, $localbusiness, $organization ), $ld_events, $ld_faq );
if ( ! empty( $ld_graph ) ) {
$jsonld_data = array(
'@context' => 'https://schema.org',
'@graph' => $ld_graph,
);
echo '' . "\n";
}
?>