Final. Deploy ready
This commit is contained in:
parent
67d59c1779
commit
11c7b14501
@ -1,7 +0,0 @@
|
|||||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
|
||||||
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
|
||||||
QyNTUxOQAAACAVIzu3dhfAF9rGLT+6HvrPXGZazG71LqDOKhZFCi4WKQAAAJjlqm3K5apt
|
|
||||||
ygAAAAtzc2gtZWQyNTUxOQAAACAVIzu3dhfAF9rGLT+6HvrPXGZazG71LqDOKhZFCi4WKQ
|
|
||||||
AAAEBo4HFL34i9aRbrMs1cKTl1UNyKMYl39gy1RvOUfFAzeBUjO7d2F8AX2sYtP7oe+s9c
|
|
||||||
ZlrMbvUuoM4qFkUKLhYpAAAAEHdlYi1naXQtcHVzaC1kZXYBAgMEBQ==
|
|
||||||
-----END OPENSSH PRIVATE KEY-----
|
|
||||||
@ -1 +0,0 @@
|
|||||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBUjO7d2F8AX2sYtP7oe+s9cZlrMbvUuoM4qFkUKLhYp web-git-push-dev
|
|
||||||
@ -1,965 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* --- Удаляем мета из YOASTSEO START--- */
|
|
||||||
add_filter( 'wpseo_json_ld_output', '__return_false' );
|
|
||||||
/* --- Удаляем мета из YOASTSEO END --- */
|
|
||||||
add_theme_support('title-tag');
|
|
||||||
/* --- #SEND Review Form --- */
|
|
||||||
add_action( 'template_redirect', 'author_archive_redirect' );
|
|
||||||
add_filter( 'author_link', 'remove_author_pages_link' );
|
|
||||||
// редиректим на главную со страниц авторов
|
|
||||||
function author_archive_redirect() {
|
|
||||||
if( is_author() ) {
|
|
||||||
wp_redirect( home_url(), 301 );
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// удаляем ссылку
|
|
||||||
function remove_author_pages_link( $content ) {
|
|
||||||
return home_url();
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
/* --- Courses --- */
|
|
||||||
add_action( 'init', 'create_courses_hierarchical_taxonomy', 0 );
|
|
||||||
function create_courses_hierarchical_taxonomy() {
|
|
||||||
$labels = array(
|
|
||||||
'name' => _x( 'Категории курсов', 'taxonomy general name' ),
|
|
||||||
'singular_name' => _x( 'Категория курсов', 'taxonomy singular name' ),
|
|
||||||
'search_items' => __( 'Поиск курсов по категории' ),
|
|
||||||
'all_items' => __( 'Все категории курсов' ),
|
|
||||||
'parent_item' => __( 'Родительская категория курсов' ),
|
|
||||||
'parent_item_colon' => __( 'Родителькая категория курсов:' ),
|
|
||||||
'edit_item' => __( 'Редактировать категорию' ),
|
|
||||||
'update_item' => __( 'Обновить категорию' ),
|
|
||||||
'add_new_item' => __( 'Добавить новую категорию' ),
|
|
||||||
'new_item_name' => __( 'Новая категория' ),
|
|
||||||
'menu_name' => __( 'Категории курсов' ),
|
|
||||||
);
|
|
||||||
register_taxonomy('courses', array('course'), array(
|
|
||||||
'hierarchical' => true,
|
|
||||||
'labels' => $labels,
|
|
||||||
'show_ui' => true,
|
|
||||||
'show_admin_column' => true,
|
|
||||||
'query_var' => true,
|
|
||||||
'rewrite' => array( 'slug' => 'courses' ),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
add_action( 'init', 'create_course' );
|
|
||||||
function create_course() {
|
|
||||||
register_post_type( 'course',
|
|
||||||
array(
|
|
||||||
'labels' => array(
|
|
||||||
'name' => 'Курсы',
|
|
||||||
'singular_name' => 'Курс',
|
|
||||||
'add_new' => 'Добавить курс',
|
|
||||||
'add_new_item' => 'Добавить курс',
|
|
||||||
'edit' => 'Редактировать курс',
|
|
||||||
'edit_item' => 'Редактировать курс',
|
|
||||||
'new_item' => 'Новый курс',
|
|
||||||
'view' => 'Смотреть курс',
|
|
||||||
'view_item' => 'Смотреть курс',
|
|
||||||
'search_items' => 'Поиск курсов',
|
|
||||||
'not_found' => 'Курсы не найдены',
|
|
||||||
'not_found_in_trash' => 'В корзине нет курсов',
|
|
||||||
'parent' => 'Родительский курс'
|
|
||||||
),
|
|
||||||
'public' => true,
|
|
||||||
'exclude_from_search'=> false,
|
|
||||||
'menu_position' => 12,
|
|
||||||
'supports' => array( 'title' ),
|
|
||||||
'publicly_queryable' => true,
|
|
||||||
'menu_icon' => 'dashicons-welcome-learn-more',
|
|
||||||
'taxonomies' => array( 'courses' ),
|
|
||||||
'has_archive' => false
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
/* --- ##Cources## --- */
|
|
||||||
|
|
||||||
/* --- trainingCategory --- */
|
|
||||||
add_action( 'init', 'create_trainingCategory_hierarchical_taxonomy', 0 );
|
|
||||||
function create_trainingCategory_hierarchical_taxonomy() {
|
|
||||||
$labels = array(
|
|
||||||
'name' => _x( 'Категории', 'Категория обучения учителя' ),
|
|
||||||
'singular_name' => _x( 'Категория', 'Категория' ),
|
|
||||||
'search_items' => __( 'Поиск категории' ),
|
|
||||||
'all_items' => __( 'Все категории' ),
|
|
||||||
'parent_item' => __( 'Родительская категория' ),
|
|
||||||
'parent_item_colon' => __( 'Родительская категория:' ),
|
|
||||||
'edit_item' => __( 'Редактировать категорию' ),
|
|
||||||
'update_item' => __( 'Обновить категорию' ),
|
|
||||||
'add_new_item' => __( 'Добавить новую категорию' ),
|
|
||||||
'new_item_name' => __( 'Новая категория' ),
|
|
||||||
'menu_name' => __( 'Категории' ),
|
|
||||||
);
|
|
||||||
register_taxonomy('trainingCategory', array('teacher'), array(
|
|
||||||
'hierarchical' => true,
|
|
||||||
'labels' => $labels,
|
|
||||||
'show_ui' => true,
|
|
||||||
'show_admin_column' => true,
|
|
||||||
'query_var' => true,
|
|
||||||
'rewrite' => false, // Отключаем перезапись URL
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
// ✅ Приоритет 5 — регистрация CPT teacher ДО инициализации Carbon Fields
|
|
||||||
add_action( 'init', 'create_teacher', 5 );
|
|
||||||
function create_teacher() {
|
|
||||||
register_post_type( 'teacher',
|
|
||||||
array(
|
|
||||||
'labels' => array(
|
|
||||||
'name' => 'Преподаватели',
|
|
||||||
'singular_name' => 'Преподаватель',
|
|
||||||
'add_new' => 'Добавить преподавателя',
|
|
||||||
'add_new_item' => 'Добавить преподавателя',
|
|
||||||
'edit' => 'Редактировать преподавателя',
|
|
||||||
'edit_item' => 'Редактировать преподавателя',
|
|
||||||
'new_item' => 'Новый преподаватель',
|
|
||||||
'view' => 'Смотреть преподавателя',
|
|
||||||
'view_item' => 'Смотреть преподавателя',
|
|
||||||
'search_items' => 'Поиск преподавателей',
|
|
||||||
'not_found' => 'Преподаватели не найдены',
|
|
||||||
'not_found_in_trash' => 'В корзине нет преподавателей',
|
|
||||||
'parent' => 'Родительский преподаватель'
|
|
||||||
),
|
|
||||||
'public' => true,
|
|
||||||
'exclude_from_search'=> false,
|
|
||||||
'menu_position' => 12,
|
|
||||||
'show_in_rest' => true,
|
|
||||||
'supports' => array( 'title', 'thumbnail' ),
|
|
||||||
'publicly_queryable' => true,
|
|
||||||
'menu_icon' => 'dashicons-admin-users',
|
|
||||||
'taxonomies' => array( 'subject' ),
|
|
||||||
'has_archive' => false
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
/* --- ##Teacher## --- */
|
|
||||||
|
|
||||||
/* --- Reviews --- */
|
|
||||||
add_action( 'init', 'create_reviews' );
|
|
||||||
function create_reviews() {
|
|
||||||
register_post_type( 'reviews',
|
|
||||||
array(
|
|
||||||
'labels' => array(
|
|
||||||
'name' => 'Отзывы',
|
|
||||||
'singular_name' => 'Отзыв',
|
|
||||||
'add_new' => 'Добавить отзыв',
|
|
||||||
'add_new_item' => 'Добавить отзыв',
|
|
||||||
'edit' => 'Редактировать отзыв',
|
|
||||||
'edit_item' => 'Редактировать отзыв',
|
|
||||||
'new_item' => 'Новый отзыв',
|
|
||||||
'view' => 'Смотреть отзыв',
|
|
||||||
'view_item' => 'Смотреть отзыв',
|
|
||||||
'search_items' => 'Поиск отзывов',
|
|
||||||
'not_found' => 'Отзывы не найдены',
|
|
||||||
'not_found_in_trash' => 'В корзине нет отзывов',
|
|
||||||
'parent' => 'Родительский отзыв'
|
|
||||||
),
|
|
||||||
'public' => true,
|
|
||||||
'exclude_from_search'=> true,
|
|
||||||
'menu_position' => 13,
|
|
||||||
'supports' => array( 'title' ),
|
|
||||||
'publicly_queryable' => false,
|
|
||||||
'menu_icon' => 'dashicons-format-status',
|
|
||||||
'has_archive' => false
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
use Carbon_Fields\Container;
|
|
||||||
use Carbon_Fields\Field;
|
|
||||||
|
|
||||||
add_action( 'carbon_fields_register_fields', 'add_carbon' );
|
|
||||||
function add_carbon() {
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Настройки темы
|
|
||||||
// ====================================================
|
|
||||||
Container::make( 'theme_options', 'Настройка темы ДЕКАРТ' )
|
|
||||||
->add_tab('Основные', array(
|
|
||||||
Field::make( 'text', 'site_name', 'Название учебного центра: (используйте в названии только одинарный кавычки)' ),
|
|
||||||
Field::make( 'text', 'site_phone', 'Телефон:' ),
|
|
||||||
Field::make( 'text', 'site_phone_multi', 'Телефон (многоканальный):' ),
|
|
||||||
Field::make( 'text', 'site_mail', 'Почта для связи:' ),
|
|
||||||
Field::make( 'text', 'site_index', 'Почтовый индекс:' ),
|
|
||||||
Field::make( 'text', 'site_region', 'Область:' ),
|
|
||||||
Field::make( 'text', 'site_city', 'Город:' ),
|
|
||||||
Field::make( 'text', 'site_address', 'Адрес:' ),
|
|
||||||
Field::make( 'text', 'site_map_link', 'Ссылка на карту:' ),
|
|
||||||
Field::make( 'text', 'site_location', 'Координаты адреса (для яндекc карт):' ),
|
|
||||||
Field::make( 'text', 'site_frame_reviews', 'Ссылка на страницу с отзывами:' ),
|
|
||||||
Field::make( 'textarea', 'site_bitrix_script', 'script (формы) БИТРИКС24:' ),
|
|
||||||
Field::make( 'textarea', 'site_bitrix_vacancies', 'script (для формы связаться с нами) БИТРИКС24:' ),
|
|
||||||
Field::make( 'checkbox', 'check_banner', 'Отображать плашку со скидкой на формах "Запись на бесплатное пробное занятие"' )
|
|
||||||
->set_option_value( 'yes' ),
|
|
||||||
Field::make( 'checkbox', 'check_btn_discont', 'Не показывать кнопку "Стоимость ак. часа со скидкой"' )
|
|
||||||
->set_option_value( 'yes' ),
|
|
||||||
Field::make( 'text', 'text_banner', 'Текст в плашке:' )
|
|
||||||
->set_default_value('Всем записавшимся до 10 сентября<br class="desktop"><span>скидка 10%</span> на весь учебный год!'),
|
|
||||||
))
|
|
||||||
->add_tab('Контент', array(
|
|
||||||
Field::make( 'textarea', 'teachers_block', 'Текст в блоке "Наша команда":' ),
|
|
||||||
))
|
|
||||||
->add_tab('Цены и скидки', array(
|
|
||||||
Field::make( 'checkbox', 'early_bird_discount', 'Выводить строку "Скидка за раннюю запись.' )
|
|
||||||
->set_option_value( 'yes' ),
|
|
||||||
Field::make( 'text', 'price_hour1', 'Стоимость ак. часа один предмет:' )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
Field::make( 'text', 'price_hour2', 'Стоимость ак. часа два предмета:' )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
Field::make( 'text', 'price_hour3', 'Стоимость ак. часа три предмета:' )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
Field::make( 'text', 'price_hour4', 'Стоимость ак. часа четыре и более предметов:' )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
Field::make( 'text', 'price_hour_discount1', 'Стоимость ак. часа один предмет со скидкой:' )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
Field::make( 'text', 'price_hour_discount2', 'Стоимость ак. часа два предмета со скидкой:' )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
Field::make( 'text', 'price_hour_discount3', 'Стоимость ак. часа три предмета со скидкой:' )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
Field::make( 'text', 'price_hour_discount4', 'Стоимость ак. часа четыре и более предметов со скидкой:' )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
))
|
|
||||||
->add_tab('Социальные сети:', array(
|
|
||||||
Field::make( 'text', 'social_header_wt', 'ссылка на WhatsApp в шапке сайта' ),
|
|
||||||
Field::make( 'text', 'social_wt', 'ссылка на WhatsApp на странице "Контакты"' ),
|
|
||||||
Field::make( 'complex', 'social_media', 'Социальная сеть' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'text', 'social_media_name', 'Название:' )
|
|
||||||
->set_width( 100 ),
|
|
||||||
Field::make( 'image', 'social_media_img', 'Логотип:' )
|
|
||||||
->set_width( 20 ),
|
|
||||||
Field::make( 'text', 'social_media_link', 'Cсылка:' )
|
|
||||||
->set_width( 80 ),
|
|
||||||
)),
|
|
||||||
))
|
|
||||||
->add_tab('Галерея', array(
|
|
||||||
Field::make( 'complex', 'slider_img', 'Галерея изображений учебного центра' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'image', 'img', 'Фотография:' ),
|
|
||||||
)),
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Доп поля для всех страниц
|
|
||||||
// ====================================================
|
|
||||||
Container::make('post_meta', 'Дополнительные поля')
|
|
||||||
->where('post_type', '=', 'page')
|
|
||||||
->where('post_id', '!=', 64)
|
|
||||||
->add_fields(array(
|
|
||||||
Field::make( 'image', 'banner_img_desktop', 'Изображение для баннера (десктопная версия)' )
|
|
||||||
->help_text( 'Размер изображения (желательно) 1295px на 454px' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'image', 'banner_img_mobile', 'Изображение для баннера (мобильная версия)' )
|
|
||||||
->help_text( 'Размер изображения (желательно) 450px на 225px' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'text', 'banner_h1', 'текст для H1' )
|
|
||||||
->set_width( 100 ),
|
|
||||||
Field::make( 'text', 'banner_text', 'Дополнительный текст под H1' )
|
|
||||||
->set_width( 100 ),
|
|
||||||
Field::make( 'complex', 'page_breadcrumbs', 'Хлебные крошки' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'text', 'breadcrumbs_name', 'Название крошки:' )
|
|
||||||
->set_width( 50 ),
|
|
||||||
Field::make( 'text', 'breadcrumbs_link', 'Ссылка крошки:' )
|
|
||||||
->set_width( 50 )
|
|
||||||
->set_default_value('#'),
|
|
||||||
)),
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Доп поля для категории Курсов
|
|
||||||
// ====================================================
|
|
||||||
Container::make( 'term_meta', 'Дополнительные поля к Курсам' )
|
|
||||||
->where( 'term_taxonomy', '=', 'courses' )
|
|
||||||
->show_on_level(1)
|
|
||||||
->where( 'term_level', '=', 1 )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'image', 'snippet', 'Изображение для сниппета:' )
|
|
||||||
->set_width( 100 ),
|
|
||||||
Field::make( 'image', 'banner_img_desktop', 'Изображение для баннера (десктопная версия)' )
|
|
||||||
->help_text( 'Размер изображения (желательно) 1920px на 1030px' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'image', 'banner_img_mobile', 'Изображение для баннера (мобильная версия)' )
|
|
||||||
->help_text( 'Размер изображения (желательно) 390px на 550px' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'textarea', 'banner_content', 'Текстовый контент баннера' )
|
|
||||||
->set_width( 70 ),
|
|
||||||
Field::make( 'text', 'title_product', 'Заголовок блока курсов:' )
|
|
||||||
->set_width( 100 ),
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Уникальное имя контейнера Главной Страницы
|
|
||||||
// ====================================================
|
|
||||||
Container::make('post_meta', 'Настройки Главной Страницы')
|
|
||||||
->where('post_template', '=', 'front-page.php')
|
|
||||||
->add_fields(array(
|
|
||||||
Field::make( 'textarea', 'block_text_1', 'Текст для блока Частная школа в Щелково "Декарт"' ),
|
|
||||||
Field::make( 'image', 'main_banner_img_desktop', 'Изображение рекламного баннера (десктопная версия)' )
|
|
||||||
->help_text( 'Размер изображения (желательно) 1185px на 190px' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'image', 'main_banner_img_mobile', 'Изображение рекламного баннера (мобильная версия)' )
|
|
||||||
->help_text( 'Размер изображения (желательно) 390px на 550px' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'text', 'main_banner_link', 'УРЛ баннера:' )
|
|
||||||
->set_default_value('#'),
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Доп поля для страницы начальной школы
|
|
||||||
// ====================================================
|
|
||||||
Container::make('post_meta', 'Настройки Начальной Школы')
|
|
||||||
->where('post_template', '=', 'page-school.php')
|
|
||||||
->add_fields(array(
|
|
||||||
Field::make( 'textarea', 'teachers_block', 'Текст в блоке "Наша команда":' ),
|
|
||||||
Field::make( 'image', 'main_banner_img_desktop', 'Изображение рекламного баннера (десктопная версия)' )
|
|
||||||
->help_text( 'Размер изображения (желательно) 1185px на 190px' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'image', 'main_banner_img_mobile', 'Изображение рекламного баннера (мобильная версия)' )
|
|
||||||
->help_text( 'Размер изображения (желательно) 390px на 550px' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'text', 'main_banner_link', 'УРЛ баннера:' )
|
|
||||||
->set_default_value('#'),
|
|
||||||
Field::make( 'textarea', 'block_text_1', 'Текст для блока "Персональный план развития для каждого ученика"' ),
|
|
||||||
Field::make( 'textarea', 'block_text_2', 'Текст для блока - Почему начальная частная школа "Декарт", а не государственная?' ),
|
|
||||||
Field::make( 'textarea', 'block_text_3', 'Текст для блока "Семейные классы в Щелково"' ),
|
|
||||||
Field::make( 'complex', 'questions', 'Блок вопросы и ответы' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'textarea', 'questions_question', 'Текст вопроса' )
|
|
||||||
->set_width( 30 ),
|
|
||||||
Field::make( 'textarea', 'questions_answer', 'Текст ответа' )
|
|
||||||
->set_width( 70 ),
|
|
||||||
)),
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Доп поля для страницы "ВСЕ КУРСЫ"
|
|
||||||
// ====================================================
|
|
||||||
Container::make('post_meta', 'Настройки Страницы Все Курсы')
|
|
||||||
->where('post_template', '=', 'page-course.php')
|
|
||||||
->add_fields(array(
|
|
||||||
Field::make( 'image', 'banner_img_desktop', 'Изображение для баннера (десктопная версия)' )
|
|
||||||
->help_text( 'Размер изображения (желательно) 1920px на 440px' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'image', 'banner_img_mobile', 'Изображение для баннера (мобильная версия)' )
|
|
||||||
->help_text( 'Размер изображения (желательно) 450px на 225px' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Доп поля для страницы "ВАКАНСИИ"
|
|
||||||
// ====================================================
|
|
||||||
Container::make('post_meta', 'Настройки Страницы ВАКАНСИИ')
|
|
||||||
->where('post_template', '=', 'page-vacancies.php')
|
|
||||||
->add_fields(array(
|
|
||||||
Field::make( 'complex', 'vacancies', 'Вакансии учебного центра:' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'text', 'vacancie_name', 'Название вакансии:' ),
|
|
||||||
Field::make( 'text', 'vacancie_link', 'Ссылка на страницу вакансии:' ),
|
|
||||||
))
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Доп поля для страницы "КОНТАКТЫ"
|
|
||||||
// ====================================================
|
|
||||||
Container::make('post_meta', 'Настройки Страницы Контакты')
|
|
||||||
->where('post_template', '=', 'page-contacts.php')
|
|
||||||
->add_fields(array(
|
|
||||||
Field::make( 'image', 'img_school', 'Изображение школы:' )
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Доп поля для категории (ПРЕДМЕТ)
|
|
||||||
// ====================================================
|
|
||||||
Container::make('term_meta', 'Category Properties')
|
|
||||||
->where('term_taxonomy', '=', 'subject')
|
|
||||||
->show_on_level(1)
|
|
||||||
->where('term_level', '=', 1)
|
|
||||||
->add_fields(array(
|
|
||||||
Field::make('text', 'subject_h1', 'Заголовок H1:')
|
|
||||||
->set_width( 100 )
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Доп поля для сущностей reviews (ОТЗЫВ)
|
|
||||||
// ====================================================
|
|
||||||
Container::make('post_meta', 'Поля для отзыва')
|
|
||||||
->where('post_type', '=', 'reviews')
|
|
||||||
->add_fields(array(
|
|
||||||
Field::make( 'radio', 'review_type', 'Тип отзыва' )
|
|
||||||
->set_options( [
|
|
||||||
'camp' => 'О лагере',
|
|
||||||
'school' => 'О школе',
|
|
||||||
'primary' => 'О начальной школе',
|
|
||||||
] )
|
|
||||||
->set_default_value( 'school' )
|
|
||||||
->set_help_text( 'Выберите тип отзыва' ),
|
|
||||||
Field::make( 'image', 'review_avatar', 'Автар:' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'text', 'review_star', 'Оценка:' )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
Field::make( 'textarea', 'review_text', 'Текст отзыва:' )
|
|
||||||
->set_width( 100 ),
|
|
||||||
Field::make('association', 'review_teacher', 'Выберите преподавателя:')
|
|
||||||
->set_width( 32 )
|
|
||||||
->set_types(array(
|
|
||||||
array(
|
|
||||||
'type' => 'post',
|
|
||||||
'post_type' => 'teacher',
|
|
||||||
)
|
|
||||||
))
|
|
||||||
->set_required(true)
|
|
||||||
->set_max(1)
|
|
||||||
->help_text( 'выбирается только один' ),
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Доп поля для записей teacher
|
|
||||||
// ====================================================
|
|
||||||
Container::make( 'post_meta', 'Поля для преподавателя' )
|
|
||||||
->where( 'post_type', '=', 'teacher' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'text', 'teacher_direction', 'Направление преподавателя (текст в под фото):' ),
|
|
||||||
Field::make( 'image', 'teacher_avatar', 'Автар:' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'textarea', 'teacher_description', 'Дескрипшн преподавателя' )
|
|
||||||
->set_width( 75 ),
|
|
||||||
Field::make( 'textarea', 'teacher_about', 'О себе:' ),
|
|
||||||
Field::make( 'textarea', 'teacher_education', 'Образование:' ),
|
|
||||||
Field::make( 'textarea', 'teacher_add_education', 'Дополнительное образование:' ),
|
|
||||||
Field::make( 'text', 'teacher_rating', 'Оценка преподавателя' )
|
|
||||||
->set_width( 10 )
|
|
||||||
->set_default_value('5'),
|
|
||||||
Field::make( 'complex', 'teacher_subjects', 'Предметы обучения' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'text', 'teacher_subjects_title', 'Укажите заголовок предмета' )
|
|
||||||
->set_width( 50 )
|
|
||||||
->set_required(true)
|
|
||||||
->help_text( 'Например: Репетитор по математике' ),
|
|
||||||
Field::make( 'textarea', 'select_direction', 'Укажите все направления преподавателя:' )
|
|
||||||
->help_text( 'Пример: <span>Математика</span><span>Русский язык</span>'),
|
|
||||||
Field::make('association', 'select_category', 'Укажите категрии')
|
|
||||||
->set_width( 100 )
|
|
||||||
->set_types(array(
|
|
||||||
array(
|
|
||||||
'type' => 'term',
|
|
||||||
'taxonomy' => 'trainingCategory',
|
|
||||||
)
|
|
||||||
))
|
|
||||||
->help_text( 'В списке указаны все возможные категрии в обучении, выберите необходимые' ),
|
|
||||||
)),
|
|
||||||
Field::make( 'complex', 'certificates', 'Дипломы и сертификаты' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'image', 'certificates_foto', 'Изображение' )
|
|
||||||
))
|
|
||||||
->help_text( 'Добавьте изображение дипломов и сертификатов преподавателя' ),
|
|
||||||
Field::make( 'text', 'teacher_video', 'Ссылка на видеопрезентацию' )
|
|
||||||
->set_width( 100 )
|
|
||||||
->help_text( 'Укажите ссылку на видео в youtube. Пример: <iframe src="https://vk.com/video_ext.php?oid=-43228812&id=456240170hd=2" width="853" height="480" allow="autoplay; encrypted-media; fullscreen; picture-in-picture;" frameborder="0" allowfullscreen></iframe>' ),
|
|
||||||
Field::make( 'complex', 'questions', 'Блок вопросы и ответы' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'textarea', 'questions_question', 'Текст вопроса' )
|
|
||||||
->set_width( 30 ),
|
|
||||||
Field::make( 'textarea', 'questions_answer', 'Текст ответа' )
|
|
||||||
->set_width( 70 ),
|
|
||||||
)),
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Уникальное имя контейнера Продлёнки
|
|
||||||
// ====================================================
|
|
||||||
Container::make('post_meta', 'Настройки Продлёнки')
|
|
||||||
->where('post_template', '=', 'page-after-school.php')
|
|
||||||
->add_tab('Общие', array(
|
|
||||||
Field::make( 'text', 'as_address', 'Наш адрес:' ),
|
|
||||||
Field::make( 'text', 'as_price', 'Цена:' ),
|
|
||||||
))
|
|
||||||
->add_tab('Педагоги', array(
|
|
||||||
Field::make( 'complex', 'as_mentors', 'Педагоги' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'image', 'mentor_foto', 'Фотография:' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'text', 'mentor_name', 'ФИО:' )
|
|
||||||
->set_width( 30 ),
|
|
||||||
Field::make( 'text', 'mentor_directions', 'Описание:' )
|
|
||||||
->set_width( 55 ),
|
|
||||||
))
|
|
||||||
))
|
|
||||||
->add_tab('Распорядок дня', array(
|
|
||||||
Field::make( 'textarea', 'as_routine', 'Блок "Распорядок дня":' ),
|
|
||||||
))
|
|
||||||
->add_tab('Отзывы', array(
|
|
||||||
Field::make( 'complex', 'as_reviews', 'Отзывы клиентов:' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'image', 'review_avatar', 'Автар:' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'text', 'review_name', 'Имя:' )
|
|
||||||
->set_width( 30 ),
|
|
||||||
Field::make( 'text', 'review_star', 'Оценка:' )
|
|
||||||
->set_width( 15 )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
Field::make( 'textarea', 'review_text', 'Текст отзыва:' )
|
|
||||||
->set_width( 100 ),
|
|
||||||
)),
|
|
||||||
))
|
|
||||||
->add_tab('Вопросы-Ответы', array(
|
|
||||||
Field::make( 'complex', 'as_questions', 'Блок вопросы и ответы' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'textarea', 'questions_question', 'Текст вопроса' )
|
|
||||||
->set_width( 30 ),
|
|
||||||
Field::make( 'textarea', 'questions_answer', 'Текст ответа' )
|
|
||||||
->set_width( 70 ),
|
|
||||||
)),
|
|
||||||
))
|
|
||||||
->add_tab('Фото', array(
|
|
||||||
Field::make( 'complex', 'as_fotos', 'Фотографии:' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'image', 'foto', 'Фото' )
|
|
||||||
)),
|
|
||||||
))
|
|
||||||
->add_tab('Битрикс', array(
|
|
||||||
Field::make( 'textarea', 'as_bitrix_script', 'script (формы) БИТРИКС24:' ),
|
|
||||||
));
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// Доп поля для страницы "ГОРОДСКОЙ ЛАГЕРЬ"
|
|
||||||
// ====================================================
|
|
||||||
Container::make('post_meta', 'Настройки Городской Лагерь')
|
|
||||||
->where('post_template', '=', 'page-camp.php')
|
|
||||||
->add_tab('Hero (новый дизайн)', array(
|
|
||||||
Field::make( 'image', 'banner_img', 'Фото в Hero-секции (главное изображение):' )
|
|
||||||
->set_help_text( 'Рекомендуемый размер: 840×560 px, WebP. Будет автоматически обрезано до 840px.' ),
|
|
||||||
Field::make( 'image', 'hero_img_mobile', 'Фото Hero для мобильных (опционально):' )
|
|
||||||
->set_help_text( 'Рекомендуемый размер: 480×320 px, WebP. Если не заполнено — используется главное фото.' ),
|
|
||||||
Field::make( 'text', 'hero_title_h1', 'Заголовок H1 (первая часть):' )
|
|
||||||
->set_default_value( 'Mind-Blowing Innovation.' ),
|
|
||||||
Field::make( 'text', 'hero_title_span', 'Заголовок span (вторая часть, цветная):' )
|
|
||||||
->set_default_value( 'Big Summer Fun!' ),
|
|
||||||
Field::make( 'textarea', 'banner_text', 'Текст под заголовком:' )
|
|
||||||
->set_default_value( 'Городской лагерь для детей 7–14 лет: наука, творчество и настоящие приключения каждый день' ),
|
|
||||||
Field::make( 'separator', 'hero_cta_sep', 'Кнопки' ),
|
|
||||||
Field::make( 'text', 'hero_btn_primary', 'Текст главной кнопки:' )
|
|
||||||
->set_default_value( 'Записаться на пробный день' ),
|
|
||||||
Field::make( 'text', 'hero_btn_secondary', 'Текст второй кнопки:' )
|
|
||||||
->set_default_value( 'Посмотреть программу' ),
|
|
||||||
Field::make( 'text', 'hero_btn_primary_link', 'Ссылка с главной кнопки (ID смены или URL):' )
|
|
||||||
->set_default_value( '#programs' ),
|
|
||||||
Field::make( 'text', 'hero_btn_secondary_link', 'Ссылка с второй кнопки:' )
|
|
||||||
->set_default_value( '#programs' ),
|
|
||||||
Field::make( 'separator', 'hero_search_sep', 'Форма поиска лагеря' ),
|
|
||||||
Field::make( 'text', 'hero_search_title', 'Заголовок формы поиска:' )
|
|
||||||
->set_default_value( 'Find the Camp Galileo Closest to You' ),
|
|
||||||
Field::make( 'text', 'hero_search_placeholder', 'Плейсхолдер поля поиска:' )
|
|
||||||
->set_default_value( 'Search by Zip Code' ),
|
|
||||||
Field::make( 'separator', 'hero_metrics_sep', 'Метрики доверия' ),
|
|
||||||
Field::make( 'text', 'hero_metric_1_icon', 'Иконка метрики 1 (emoji):' )
|
|
||||||
->set_default_value( '🏆' ),
|
|
||||||
Field::make( 'text', 'hero_metric_1_text', 'Текст метрики 1:' )
|
|
||||||
->set_default_value( '12 лет в городе' ),
|
|
||||||
Field::make( 'text', 'hero_metric_2_icon', 'Иконка метрики 2 (emoji):' )
|
|
||||||
->set_default_value( '👶' ),
|
|
||||||
Field::make( 'text', 'hero_metric_2_text', 'Текст метрики 2:' )
|
|
||||||
->set_default_value( '2 500+ счастливых детей' ),
|
|
||||||
Field::make( 'text', 'hero_metric_3_icon', 'Иконка метрики 3 (emoji):' )
|
|
||||||
->set_default_value( '⭐' ),
|
|
||||||
Field::make( 'text', 'hero_metric_3_text', 'Текст метрики 3:' )
|
|
||||||
->set_default_value( '4.9 / 5 — рейтинг от родителей' ),
|
|
||||||
))
|
|
||||||
->add_tab('Дополнительный баннер', array(
|
|
||||||
Field::make( 'image', 'banner_add_img', 'Фоновое изображение баннера' ),
|
|
||||||
Field::make( 'text', 'banner_add_title', 'Текст заголовка:' ),
|
|
||||||
Field::make( 'textarea', 'banner_add_text', 'Текст под заголовком:' ),
|
|
||||||
Field::make( 'text', 'banner_add_text_min', 'Сноска (под кнопкой):' )
|
|
||||||
))
|
|
||||||
->add_tab('Дополнительный баннер-2', array(
|
|
||||||
Field::make( 'image', 'banner_add_img2', 'Фоновое изображение баннера' ),
|
|
||||||
Field::make( 'text', 'banner_add_title2', 'Текст заголовка:' ),
|
|
||||||
Field::make( 'textarea', 'banner_add_text2', 'Текст под заголовком:' ),
|
|
||||||
Field::make( 'text', 'banner_add_text_min2', 'Сноска (под кнопкой):' )
|
|
||||||
))
|
|
||||||
->add_tab('Мы предлагаем', array(
|
|
||||||
Field::make( 'complex', 'suggestions', 'Блок "Что мы предлагаем"' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'image', 'suggestions_img', 'Изображение для баннера (десктопная версия)' ),
|
|
||||||
Field::make( 'text', 'suggestions_title', 'Текст заголовка:' ),
|
|
||||||
Field::make( 'textarea', 'suggestions_text', 'Текст под заголовком:' )
|
|
||||||
)),
|
|
||||||
))
|
|
||||||
->add_tab('Программы', array(
|
|
||||||
Field::make( 'text', 'price_half_day', 'Стоимость за половину дня:' )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
Field::make( 'text', 'price_full_day', 'Стоимость за весь день:' )
|
|
||||||
->set_attribute( 'type', 'number' ),
|
|
||||||
Field::make( 'complex', 'programs', 'Блок "Весенние и летние программы"' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'image', 'programs_img', 'Изображение для баннера (десктопная версия)' ),
|
|
||||||
Field::make( 'text', 'programs_title', 'Текст заголовка:' ),
|
|
||||||
Field::make( 'text', 'programs_date', 'Даты проведения:' ),
|
|
||||||
Field::make( 'textarea', 'programs_text', 'Описание в карточке:' ),
|
|
||||||
Field::make( 'text', 'programs_price', 'Стоимость:' )
|
|
||||||
->set_attribute( 'type', 'number' )
|
|
||||||
->set_width( 30 ),
|
|
||||||
Field::make( 'text', 'programs_days', 'Количество дней:' )
|
|
||||||
->set_width( 30 ),
|
|
||||||
Field::make( 'rich_text', 'programs_content', 'Описание для всплывающего окна:' ),
|
|
||||||
)),
|
|
||||||
))
|
|
||||||
->add_tab('Наставники', array(
|
|
||||||
Field::make( 'complex', 'mentors', 'Наставники' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make('association', 'mentor', 'Выберите наставника')
|
|
||||||
->set_width( 32 )
|
|
||||||
->set_types(array(
|
|
||||||
array(
|
|
||||||
'type' => 'post',
|
|
||||||
'post_type' => 'teacher',
|
|
||||||
)
|
|
||||||
))
|
|
||||||
->set_max(1)
|
|
||||||
->help_text( 'выбирается только один наставник для вкладки' ),
|
|
||||||
Field::make( 'text', 'mentor_job', 'Должность:' ),
|
|
||||||
Field::make( 'complex', 'mentor_directions', 'Направления наставника:' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'text', 'direction_name', 'Название направления:' ),
|
|
||||||
)),
|
|
||||||
Field::make( 'text', 'mentor_experience', 'Опыт работы в сфере образования:' ),
|
|
||||||
))
|
|
||||||
))
|
|
||||||
->add_tab('Распорядок дня', array(
|
|
||||||
Field::make( 'complex', 'routine', 'Блок "Распорядок дня"' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'text', 'routine_time', 'Время:' )
|
|
||||||
->set_width( 15 ),
|
|
||||||
Field::make( 'text', 'routine_title', 'Название мероприятия:' )
|
|
||||||
->set_width( 40 ),
|
|
||||||
Field::make( 'textarea', 'routine_text', 'Описание мероприятия:' )
|
|
||||||
->set_width( 45 ),
|
|
||||||
))
|
|
||||||
))
|
|
||||||
->add_tab('Фотографии', array(
|
|
||||||
Field::make( 'complex', 'fotos', 'Блок с фотографиями' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'image', 'foto', 'Фотография:' )
|
|
||||||
)),
|
|
||||||
Field::make( 'rich_text', 'fotos_content', 'Текстовый контент:' ),
|
|
||||||
Field::make( 'text', 'fotos_link_vk', 'Ссылка на ВК:' )
|
|
||||||
->set_default_value('#')
|
|
||||||
))
|
|
||||||
->add_tab('Вопросы-Ответы', array(
|
|
||||||
Field::make( 'complex', 'questions', 'Блок вопросы и ответы' )
|
|
||||||
->set_layout( 'tabbed-horizontal' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'textarea', 'questions_question', 'Текст вопроса' )
|
|
||||||
->set_width( 30 ),
|
|
||||||
Field::make( 'textarea', 'questions_answer', 'Текст ответа' )
|
|
||||||
->set_width( 70 ),
|
|
||||||
)),
|
|
||||||
))
|
|
||||||
->add_tab('Контакты', array(
|
|
||||||
Field::make( 'text', 'contact_address', 'Адрес:' ),
|
|
||||||
Field::make( 'text', 'contact_location', 'Координаты адреса (для яндекc карт):' ),
|
|
||||||
Field::make( 'text', 'contact_location_text', 'Название метки на карте' ),
|
|
||||||
Field::make( 'text', 'contact_tel', 'Телефон' ),
|
|
||||||
Field::make( 'text', 'contact_mail', 'Електронная почта:' ),
|
|
||||||
Field::make( 'complex', 'social_media', 'Социальная сеть' )
|
|
||||||
->add_fields( array(
|
|
||||||
Field::make( 'text', 'social_media_name', 'Название:' )
|
|
||||||
->set_width( 100 ),
|
|
||||||
Field::make( 'image', 'social_media_img', 'Логотип:' )
|
|
||||||
->set_width( 20 ),
|
|
||||||
Field::make( 'text', 'social_media_link', 'Cсылка:' )
|
|
||||||
->set_width( 80 ),
|
|
||||||
)),
|
|
||||||
))
|
|
||||||
->add_tab('Битрикс', array(
|
|
||||||
Field::make( 'textarea', 'camp_bitrix_script', 'script (формы) БИТРИКС24:' ),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
// функция получения id курса по его названию
|
|
||||||
function get_post_by_title($page_title) {
|
|
||||||
$query = new WP_Query(
|
|
||||||
[
|
|
||||||
'post_type' => 'course',
|
|
||||||
'title' => $page_title,
|
|
||||||
'post_status' => 'publish',
|
|
||||||
'posts_per_page' => 1,
|
|
||||||
'update_post_term_cache' => false,
|
|
||||||
'update_post_meta_cache' => false,
|
|
||||||
'orderby' => 'post_date ID',
|
|
||||||
'order' => 'ASC',
|
|
||||||
'no_found_rows' => true,
|
|
||||||
'ignore_sticky_posts' => true,
|
|
||||||
]);
|
|
||||||
wp_reset_postdata();
|
|
||||||
if ( $query->post ) return $query->post->ID;
|
|
||||||
else return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// функция случайного цвета
|
|
||||||
function rand_color() {
|
|
||||||
return sprintf('#%06X', mt_rand(0, 0xFFFFFF));
|
|
||||||
}
|
|
||||||
|
|
||||||
add_theme_support( 'post-thumbnails' );
|
|
||||||
|
|
||||||
add_action('pre_get_posts', 'exclude_custom_taxonomy_posts');
|
|
||||||
function exclude_custom_taxonomy_posts($query) {
|
|
||||||
if (!is_admin() && $query->is_main_query() && ($query->is_tax('trainingCategory') || $query->is_tax('direction'))) {
|
|
||||||
$query->set_404();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function add_og_image() {
|
|
||||||
$term = get_queried_object();
|
|
||||||
if ($term->term_id) {
|
|
||||||
$snippet = carbon_get_term_meta( $term->term_id, 'snippet' );
|
|
||||||
if ($snippet != '') echo '<meta property="og:image" content="' . wp_get_attachment_url($snippet) . '" />' . "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
add_action( 'wp_head', 'add_og_image' );
|
|
||||||
|
|
||||||
function yoastVariableToTitle($post_id) {
|
|
||||||
$yoast_title = get_post_meta($post_id, '_yoast_wpseo_title', true);
|
|
||||||
$title = strstr($yoast_title, '%%', true);
|
|
||||||
if (empty($title)) {
|
|
||||||
$title = get_the_title($post_id);
|
|
||||||
}
|
|
||||||
$wpseo_titles = get_option('wpseo_titles');
|
|
||||||
$sep_options = WPSEO_Option_Titles::get_instance()->get_separator_options();
|
|
||||||
if (isset($wpseo_titles['separator']) && isset($sep_options[$wpseo_titles['separator']])) {
|
|
||||||
$sep = $sep_options[$wpseo_titles['separator']];
|
|
||||||
} else {
|
|
||||||
$sep = '-';
|
|
||||||
}
|
|
||||||
$site_title = get_bloginfo('name');
|
|
||||||
$meta_title = $title . ' ' . $sep . ' ' . $site_title;
|
|
||||||
return $meta_title;
|
|
||||||
}
|
|
||||||
|
|
||||||
function replaceQuotes($text) {
|
|
||||||
$text = str_replace(['"'], "'", $text);
|
|
||||||
return $text;
|
|
||||||
}
|
|
||||||
|
|
||||||
function enqueue_template_specific_styles() {
|
|
||||||
if ( is_page_template('page-camp.php') ) {
|
|
||||||
wp_enqueue_style(
|
|
||||||
'template-specific-style',
|
|
||||||
get_template_directory_uri() . '/assets/css/camp.css',
|
|
||||||
array(),
|
|
||||||
'1.0'
|
|
||||||
);
|
|
||||||
wp_enqueue_script(
|
|
||||||
'camp-script',
|
|
||||||
get_template_directory_uri() . '/assets/js/camp.js',
|
|
||||||
NULL,
|
|
||||||
'1.0.0',
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if ( is_page_template('page-after-school.php') ) {
|
|
||||||
wp_enqueue_style(
|
|
||||||
'template-after-style',
|
|
||||||
get_template_directory_uri() . '/assets/css/after-school.css',
|
|
||||||
array(),
|
|
||||||
'1.0'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
add_action('wp_enqueue_scripts', 'enqueue_template_specific_styles');
|
|
||||||
|
|
||||||
add_shortcode( 'get_form_bitrix', 'form_bitrix' );
|
|
||||||
function form_bitrix( $atts, $content = null ) {
|
|
||||||
return carbon_get_theme_option( 'site_bitrix_script' );
|
|
||||||
}
|
|
||||||
|
|
||||||
add_shortcode( 'get_reviews', 'sc_reviews' );
|
|
||||||
function sc_reviews( $atts ) {
|
|
||||||
$atts = shortcode_atts( [
|
|
||||||
'type' => 'school',
|
|
||||||
], $atts );
|
|
||||||
set_query_var( 'type', $atts['type'] );
|
|
||||||
ob_start();
|
|
||||||
load_template( locate_template( '/template-parts/reviews.php' ), false );
|
|
||||||
return ob_get_clean();
|
|
||||||
}
|
|
||||||
|
|
||||||
add_shortcode( 'get_teachers', 'sc_teachers' );
|
|
||||||
function sc_teachers( $atts, $content = null ) {
|
|
||||||
ob_start();
|
|
||||||
set_query_var( 'sc_teachers', '1' );
|
|
||||||
load_template( locate_template( '/template-parts/teachers.php' ), false );
|
|
||||||
return ob_get_clean();
|
|
||||||
}
|
|
||||||
|
|
||||||
function fix_page_1_in_pagination( $link ) {
|
|
||||||
$reviews_page_id = 91;
|
|
||||||
$root_url = get_permalink( $reviews_page_id );
|
|
||||||
if ( substr( $root_url, -1 ) !== '/' ) {
|
|
||||||
$root_url .= '/';
|
|
||||||
}
|
|
||||||
if ( isset($_GET['filter']) ) {
|
|
||||||
$root_url = add_query_arg('filter', esc_attr($_GET['filter']), $root_url);
|
|
||||||
}
|
|
||||||
$page_1_url_full = get_pagenum_link(1);
|
|
||||||
if (substr($page_1_url_full, -1) !== '/') {
|
|
||||||
$page_1_url_full .= '/';
|
|
||||||
}
|
|
||||||
$canonical_root_url = get_permalink($reviews_page_id);
|
|
||||||
if (substr($canonical_root_url, -1) !== '/') {
|
|
||||||
$canonical_root_url .= '/';
|
|
||||||
}
|
|
||||||
if (isset($_GET['filter'])) {
|
|
||||||
$canonical_root_url = add_query_arg('filter', esc_attr($_GET['filter']), $canonical_root_url);
|
|
||||||
}
|
|
||||||
$link = str_replace(
|
|
||||||
'href="' . esc_url($page_1_url_full) . '"',
|
|
||||||
'href="' . esc_url($canonical_root_url) . '"',
|
|
||||||
$link
|
|
||||||
);
|
|
||||||
$link = str_replace(
|
|
||||||
'href="' . esc_url(get_pagenum_link(1)) . '"',
|
|
||||||
'href="' . esc_url($canonical_root_url) . '"',
|
|
||||||
$link
|
|
||||||
);
|
|
||||||
return $link;
|
|
||||||
}
|
|
||||||
add_filter( 'paginate_links', 'fix_page_1_in_pagination' );
|
|
||||||
|
|
||||||
remove_action('wp_head', 'wp_generator');
|
|
||||||
remove_action('wp_head', 'rest_output_link_wp_head');
|
|
||||||
remove_action('wp_head', 'wp_oembed_add_discovery_links');
|
|
||||||
remove_action('wp_head', 'wp_shortlink_wp_head');
|
|
||||||
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
|
|
||||||
remove_action('template_redirect', 'rest_output_link_header', 11);
|
|
||||||
|
|
||||||
function dekart_disable_emojis() {
|
|
||||||
remove_action('wp_head', 'print_emoji_detection_script', 7);
|
|
||||||
remove_action('admin_print_scripts', 'print_emoji_detection_script');
|
|
||||||
remove_action('wp_print_styles', 'print_emoji_styles');
|
|
||||||
remove_action('admin_print_styles', 'print_emoji_styles');
|
|
||||||
remove_filter('the_content_feed', 'wp_staticize_emoji');
|
|
||||||
remove_filter('comment_text_rss', 'wp_staticize_emoji');
|
|
||||||
remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
|
|
||||||
add_filter('tiny_mce_plugins', 'dekart_disable_emojis_tinymce');
|
|
||||||
add_filter('wp_resource_hints', 'dekart_disable_emojis_remove_dns_prefetch', 10, 2);
|
|
||||||
}
|
|
||||||
add_action('init', 'dekart_disable_emojis');
|
|
||||||
|
|
||||||
function dekart_disable_emojis_tinymce($plugins) {
|
|
||||||
if (is_array($plugins)) {
|
|
||||||
return array_diff($plugins, array('wpemoji'));
|
|
||||||
}
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
|
|
||||||
function dekart_disable_emojis_remove_dns_prefetch($urls, $relation_type) {
|
|
||||||
if ('dns-prefetch' === $relation_type) {
|
|
||||||
$emoji_svg_url = apply_filters('emoji_svg_url', 'https://s.w.org/images/core/emoji/');
|
|
||||||
$urls = array_diff($urls, array($emoji_svg_url));
|
|
||||||
}
|
|
||||||
return $urls;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// ✅ Оптимизация скриптов — defer только на фронтенде
|
|
||||||
// ====================================================
|
|
||||||
function dekart_add_defer_to_scripts($tag, $handle, $src) {
|
|
||||||
// Не деферим скрипты в админке, AJAX и REST запросах
|
|
||||||
if ( is_admin() || wp_doing_ajax() || ( defined('REST_REQUEST') && REST_REQUEST ) ) {
|
|
||||||
return $tag;
|
|
||||||
}
|
|
||||||
$no_defer = array(
|
|
||||||
'jquery-core',
|
|
||||||
'jquery',
|
|
||||||
'carbon-fields-script',
|
|
||||||
'wp-api-request',
|
|
||||||
'wp-element',
|
|
||||||
'wp-components',
|
|
||||||
);
|
|
||||||
if (in_array($handle, $no_defer)) {
|
|
||||||
return $tag;
|
|
||||||
}
|
|
||||||
if (strpos($tag, 'defer') !== false || strpos($tag, 'async') !== false) {
|
|
||||||
return $tag;
|
|
||||||
}
|
|
||||||
return str_replace('<script ', '<script defer ', $tag);
|
|
||||||
}
|
|
||||||
add_filter('script_loader_tag', 'dekart_add_defer_to_scripts', 10, 3);
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// ✅ Заголовки безопасности — только на фронтенде
|
|
||||||
// ====================================================
|
|
||||||
function dekart_security_headers() {
|
|
||||||
// Не применяем в админке, AJAX и cron
|
|
||||||
if ( is_admin() || wp_doing_ajax() || defined('DOING_CRON') ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
header('X-Frame-Options: SAMEORIGIN');
|
|
||||||
header('X-XSS-Protection: 1; mode=block');
|
|
||||||
header('X-Content-Type-Options: nosniff');
|
|
||||||
header('Referrer-Policy: strict-origin-when-cross-origin');
|
|
||||||
}
|
|
||||||
add_action('send_headers', 'dekart_security_headers');
|
|
||||||
|
|
||||||
function dekart_add_preload_hints() {
|
|
||||||
// резерв для preload hints
|
|
||||||
}
|
|
||||||
add_action('wp_head', 'dekart_add_preload_hints', 1);// Тестовая строка для проверки деплоя 2026-05-06
|
|
||||||
// Updated via WordPress admin 2026-05-07
|
|
||||||
|
|
||||||
// === ACF JSON Auto-save ===
|
|
||||||
// Автоматически сохраняет группы полей в JSON при редактировании
|
|
||||||
add_filter('acf/settings/save_json', function($path) {
|
|
||||||
return get_stylesheet_directory() . '/acf-json';
|
|
||||||
});
|
|
||||||
|
|
||||||
// Загружает группы полей из JSON
|
|
||||||
add_filter('acf/settings/load_json', function($paths) {
|
|
||||||
$paths[] = get_stylesheet_directory() . '/acf-json';
|
|
||||||
return $paths;
|
|
||||||
});
|
|
||||||
|
|
||||||
// === ACF JSON Auto-save ===
|
|
||||||
// Автоматически сохраняет группы полей в JSON при редактировании
|
|
||||||
add_filter('acf/settings/save_json', function($path) {
|
|
||||||
return get_stylesheet_directory() . '/acf-json';
|
|
||||||
});
|
|
||||||
|
|
||||||
// Загружает группы полей из JSON
|
|
||||||
add_filter('acf/settings/load_json', function($paths) {
|
|
||||||
$paths[] = get_stylesheet_directory() . '/acf-json';
|
|
||||||
return $paths;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Автоматическое удаление JSON при удалении группы полей
|
|
||||||
add_action('trashed_post', 'dekart_acf_delete_json', 10, 1);
|
|
||||||
add_action('deleted_post', 'dekart_acf_delete_json', 10, 1);
|
|
||||||
function dekart_acf_delete_json($post_id) {
|
|
||||||
if (get_post_type($post_id) !== 'acf-field-group') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$key = get_post_field('post_name', $post_id);
|
|
||||||
$json_file = get_stylesheet_directory() . '/acf-json/' . $key . '.json';
|
|
||||||
|
|
||||||
if (file_exists($json_file)) {
|
|
||||||
unlink($json_file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,769 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
Template Name: Шаблон страницы Лагерь
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
get_header();
|
|
||||||
$post_id = get_the_ID();
|
|
||||||
|
|
||||||
$priceMin = 1000000;
|
|
||||||
$programs = carbon_get_post_meta($post_id, 'programs' );
|
|
||||||
|
|
||||||
if (is_array($programs)) {
|
|
||||||
foreach ($programs as $item) {
|
|
||||||
$price = (int)$item['programs_price'];
|
|
||||||
if ($price < $priceMin) $priceMin = $price;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Banner helper
|
|
||||||
*/
|
|
||||||
function getBanner($suffix, $post_id) {
|
|
||||||
$img = carbon_get_post_meta($post_id, 'banner_add_img' . $suffix);
|
|
||||||
$img_url = $img ? wp_get_attachment_url($img) : '';
|
|
||||||
if (!$img_url) return;
|
|
||||||
$title = carbon_get_post_meta($post_id, 'banner_add_title' . $suffix);
|
|
||||||
$text = carbon_get_post_meta($post_id, 'banner_add_text' . $suffix);
|
|
||||||
$note = carbon_get_post_meta($post_id, 'banner_add_text_min' . $suffix);
|
|
||||||
?>
|
|
||||||
<div class='banner banner-add' style='background-image: url(<?php echo esc_url($img_url); ?>)'>
|
|
||||||
<div class='banner__left-part'>
|
|
||||||
<div class='banner_title'><?php echo esc_html($title); ?></div>
|
|
||||||
<p class='banner_text'><?php echo esc_html($text); ?></p>
|
|
||||||
<button class='banner_btn btn-write-camp'><?php esc_html_e('ЗАБРОНИРОВАТЬ'); ?></button>
|
|
||||||
<p class='banner_text-min'><?php echo esc_html($note); ?></p>
|
|
||||||
</div>
|
|
||||||
<div class='banner__right-part'></div>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<main class="camp container_camp">
|
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* === Все данные из Carbon Fields собираем в одном месте ===
|
|
||||||
*/
|
|
||||||
$hero = [
|
|
||||||
'h1' => 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' => get_template_directory_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' => get_template_directory_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' => get_template_directory_uri() . '/assets/images/doodles/icon-award.png',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<section class="section-bg hero-media-search" data-bg="hero">
|
|
||||||
<div class="container">
|
|
||||||
<div class="hero-media-search__container">
|
|
||||||
|
|
||||||
<!-- Левая колонка -->
|
|
||||||
<div class="hero-media-search__content">
|
|
||||||
<h1 class="heading-1"><?php echo wp_kses_post( $hero['h1'] ); ?></h1>
|
|
||||||
<h2 class="hero-subtitle-brand"><?php echo wp_kses_post( $hero['span'] ); ?></h2>
|
|
||||||
|
|
||||||
<!-- Метрики (десктоп) -->
|
|
||||||
<div class="hero-media-search__propositions on-desktop">
|
|
||||||
<?php foreach ( $metrics as $metric ) : ?>
|
|
||||||
<?php render_hero_metric( $metric ); ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- CTA (десктоп) -->
|
|
||||||
<div class="hero-cta on-desktop">
|
|
||||||
<a href="#" class="btn-write-camp about-us__cta-link" aria-label="<?php echo esc_attr( $hero['btn_text'] ); ?>">
|
|
||||||
<?php echo esc_html( $hero['btn_text'] ); ?> →
|
|
||||||
</a>
|
|
||||||
<p class="hero-cta__note">Один пробный день — за наш счёт. Оцените качество сами, а решение примете после.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Правая колонка (изображение + мобильные элементы) -->
|
|
||||||
<div class="hero-media-search__media">
|
|
||||||
<div class="hero-media-search__frame">
|
|
||||||
<?php if ( $hero['image_id'] ) : ?>
|
|
||||||
<?php echo wp_get_attachment_image( $hero['image_id'], 'full', false, [
|
|
||||||
'class' => 'hero-media-search__image',
|
|
||||||
'fetchpriority' => 'high',
|
|
||||||
'loading' => 'eager',
|
|
||||||
'alt' => esc_attr( wp_trim_words( $hero['h1'], 10 ) )
|
|
||||||
] ); ?>
|
|
||||||
<?php else : ?>
|
|
||||||
<img class="hero-media-search__image"
|
|
||||||
fetchpriority="high" src="<?php echo get_template_directory_uri(); ?>/assets/images/camp-hero.jpg"
|
|
||||||
alt="Детский лагерь Декарт" loading="eager">
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<!-- Декоративные элементы -->
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/doodles/hero-doodle-gears.svg"
|
|
||||||
alt="" class="doodle doodle--top-left">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/doodles/hero-doodle-pencils.svg"
|
|
||||||
alt="" class="doodle doodle--bottom-right">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Метрики + CTA (мобильная версия) -->
|
|
||||||
<div class="hero-media-search__wrapper">
|
|
||||||
<div class="hero-media-search__propositions on-mobile">
|
|
||||||
<?php foreach ( $metrics as $metric ) : ?>
|
|
||||||
<?php render_hero_metric( $metric ); ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="hero-cta on-mobile">
|
|
||||||
<a href="#0" class="btn-write-camp about-us__cta-link" aria-label="<?php echo esc_attr( $hero['btn_text'] ); ?>">
|
|
||||||
<?php echo esc_html( $hero['btn_text'] ); ?> →
|
|
||||||
</a>
|
|
||||||
<p class="hero-cta__note">Один пробный день — за наш счёт. Оцените качество сами, а решение примете после.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="section-reveal section-bg about-us" data-bg="white">
|
|
||||||
<div class="container">
|
|
||||||
<div class="about-us__wrapper">
|
|
||||||
<div class="about-us__image-col">
|
|
||||||
<div class="about-us__frame">
|
|
||||||
<?php
|
|
||||||
$about_img_id = carbon_get_post_meta( $post_id, 'about_us_img' );
|
|
||||||
if ( $about_img_id ) :
|
|
||||||
echo wp_get_attachment_image( $about_img_id, 'large', false, [
|
|
||||||
'class' => 'about-us__image',
|
|
||||||
'loading' => 'lazy',
|
|
||||||
'alt' => 'Фото детского лагеря Декарт'
|
|
||||||
] );
|
|
||||||
else :
|
|
||||||
echo '<div class="about-us__image-placeholder">
|
|
||||||
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
||||||
<rect x="3" y="3" width="18" height="18" rx="2"/>
|
|
||||||
<circle cx="8.5" cy="8.5" r="1.5"/>
|
|
||||||
<path d="M21 15l-5-5L5 21"/>
|
|
||||||
</svg>
|
|
||||||
<span>Добавьте фото</span>
|
|
||||||
</div>';
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/doodles/galileo/paperplane-galileo.svg"
|
|
||||||
alt="" class="about-us__doodle about-us__doodle--plane">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/doodles/galileo/orangegear-white.svg"
|
|
||||||
alt="" class="about-us__doodle about-us__doodle--heart">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="about-us__content-col">
|
|
||||||
<h2 class="camp_title about-us__title">Лето, которое не хочется ставить на паузу</h2>
|
|
||||||
<div class="about-us__text">
|
|
||||||
<?php echo wp_kses_post( carbon_get_post_meta( $post_id, 'about_us_text' ) ?: 'Всю зиму ребёнок в телефоне? Бабушка устала? А ведь лето может быть другим — ярким, живым, полезным.
|
|
||||||
В Dekart дети не просто под присмотром. Они собирают роботов, ставят опыты, играют в театре, бегают на квестах и находят друзей.А главное — бегут в лагерь каждое утро без уговоров.' ); ?>
|
|
||||||
</div>
|
|
||||||
<div class="about-us__social-proof">
|
|
||||||
<span class="about-us__badge">⭐ 2500+ мам доверили нам лето</span>
|
|
||||||
</div>
|
|
||||||
<div class="about-us__cta">
|
|
||||||
<a href="#" class="btn-write-camp about-us__cta-link">Хочу на пробный день →</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="section-reveal section-bg suggestions" data-bg="mint">
|
|
||||||
<div class="container">
|
|
||||||
<h2 class="camp_title">Почему мамы выбирают Dekart: дети бегут сюда сами</h2>
|
|
||||||
<p class="suggestions__subtitle">Никаких уговоров по утрам. Никаких «забери меня». Только горящие глаза и «а можно ещё?»</p>
|
|
||||||
<div class="suggestions-wrapper"> <?php $suggestions = carbon_get_post_meta($post_id, 'suggestions' ); $icons = ['innovation-white.svg', 'steamprojects-35x35-1.svg', 'handson-35x35-1.svg', 'orangegear-white.svg', 'outdoor-white.svg', 'heart_sticker.svg'];
|
|
||||||
if (is_array($suggestions)) {
|
|
||||||
foreach ($suggestions as $index => $item) {
|
|
||||||
$suggestions_title = $item['suggestions_title'];
|
|
||||||
$suggestions_text = $item['suggestions_text'];
|
|
||||||
$icon_file = $icons[$index % count($icons)];
|
|
||||||
?> <div class="suggestions__item">
|
|
||||||
<div class="suggestions__icon-wrap">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/doodles/galileo/<?php echo $icon_file; ?>"
|
|
||||||
alt="" class="suggestions__icon">
|
|
||||||
</div>
|
|
||||||
<h3 class="suggestions__item_title"><?php echo esc_html( $suggestions_title ); ?></h3>
|
|
||||||
<p class="suggestions__item_text"><?php echo esc_html( $suggestions_text ); ?></p>
|
|
||||||
</div> <?php }
|
|
||||||
} ?> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="section-reveal section-bg infograph" data-bg="white">
|
|
||||||
<div class="container">
|
|
||||||
<h2 class="camp_title">Цифры, которые говорят сами за себя</h2>
|
|
||||||
<p class="infograph__lead">Мы создаём среду, где каждый ребёнок раскрывает свой потенциал</p>
|
|
||||||
<div class="infograph__grid">
|
|
||||||
|
|
||||||
<div class="infograph__card">
|
|
||||||
<div class="infograph__icon infograph__icon--age">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/age.svg" alt="" width="48" height="48">
|
|
||||||
</div>
|
|
||||||
<p class="infograph__stat">6,5−11 лет</p>
|
|
||||||
<p class="infograph__label">возраст</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="infograph__card">
|
|
||||||
<div class="infograph__icon infograph__icon--group">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/group.svg" alt="" width="48" height="48">
|
|
||||||
</div>
|
|
||||||
<p class="infograph__stat">до 10 детей</p>
|
|
||||||
<p class="infograph__label">каждая группа</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="infograph__card">
|
|
||||||
<div class="infograph__icon infograph__icon--time">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/time.svg" alt="" width="48" height="48">
|
|
||||||
</div>
|
|
||||||
<p class="infograph__stat">на выбор</p>
|
|
||||||
<p class="infograph__label">время посещения</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="infograph__card">
|
|
||||||
<div class="infograph__icon infograph__icon--price">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/price.svg" alt="" width="48" height="48">
|
|
||||||
</div>
|
|
||||||
<p class="infograph__stat">от <?php echo esc_html( number_format($priceMin, 0, ',', ' ') ); ?> ₽</p>
|
|
||||||
<p class="infograph__label">стоимость недели</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg programs" data-bg="mint" itemscope itemtype="https://schema.org/ItemList">
|
|
||||||
<div class="container">
|
|
||||||
<h2 class="camp_title" itemprop="name">Летние программы</h2>
|
|
||||||
<div class="programs__grid">
|
|
||||||
<?php
|
|
||||||
$programs = carbon_get_post_meta($post_id, 'programs');
|
|
||||||
if (is_array($programs)) {
|
|
||||||
foreach ($programs as $item) {
|
|
||||||
$programs_img = $item['programs_img'];
|
|
||||||
$programs_title = $item['programs_title'];
|
|
||||||
$programs_date = $item['programs_date'];
|
|
||||||
$programs_text = $item['programs_text'];
|
|
||||||
$programs_price = $item['programs_price'];
|
|
||||||
$programs_days = $item['programs_days'];
|
|
||||||
$programs_content = $item['programs_content'];?>
|
|
||||||
<article class="programs__card">
|
|
||||||
<img class="programs__image" loading="lazy" width="360" height="225" src="<?php echo wp_get_attachment_url($programs_img); ?>" alt="<?php echo get_post_meta($programs_img, '_wp_attachment_image_alt', true); ?>">
|
|
||||||
<div class="programs__body">
|
|
||||||
<h3 class="programs__name"><?php echo esc_html($programs_title); ?></h3>
|
|
||||||
<p class="programs__date"><?php echo esc_html($programs_date); ?></p>
|
|
||||||
<p class="programs__desc"><?php echo esc_html($programs_text); ?></p>
|
|
||||||
<div class="programs__footer">
|
|
||||||
<span class="programs__price"><?php echo number_format((int)$programs_price, 0, ',', ' '); ?> ₽</span>
|
|
||||||
<span class="programs__duration"><?php echo esc_html($programs_days); ?></span>
|
|
||||||
</div>
|
|
||||||
<div class="programs_content" style="display: none;"><?php echo wp_kses_post($programs_content); ?></div>
|
|
||||||
<button class="programs__btn btn-program" aria-label="Подробнее о программе <?php echo esc_attr($programs_title); ?>">Подробнее</button>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
} ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<?php getBanner('', $post_id); ?>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg bring-child" data-bg="white" itemscope itemtype="https://schema.org/Product">
|
|
||||||
<meta itemprop="name" content="Городской лагерь Декарт">
|
|
||||||
<meta itemprop="description" content="Стоимость пребывания в городском лагере Декарт">
|
|
||||||
<?php
|
|
||||||
$price_half_day = carbon_get_post_meta($post_id, 'price_half_day' );
|
|
||||||
$price_full_day = carbon_get_post_meta($post_id, 'price_full_day' );
|
|
||||||
?>
|
|
||||||
<h2 class="camp_title">Приводите ребёнка, когда вам удобно</h2>
|
|
||||||
<div class="bring-child-wrapper">
|
|
||||||
<div class="part-day camp-left-part">
|
|
||||||
<div class="part-day_title">
|
|
||||||
<div class="block-row">
|
|
||||||
<p class="part-day_title-text">Половина дня</p>
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/green-star.svg" width="30" height="30" alt="">
|
|
||||||
</div>
|
|
||||||
<p class="part-day_text">Время пребывания — на выбор (до обеда или до вечера)</p>
|
|
||||||
</div>
|
|
||||||
<div class="part-day__price">
|
|
||||||
<div class="block-row">
|
|
||||||
<div class="part-day__price_price" itemprop="offers" itemscope itemtype="https://schema.org/Offer"><span itemprop="price" content="<?php echo esc_attr($price_half_day); ?>"><?php echo number_format($price_half_day, 0, ',', ' '); ?></span><meta itemprop="priceCurrency" content="RUB"></div>
|
|
||||||
<div class="part-day__price_time">с 8:30 до 13:30</div>
|
|
||||||
</div>
|
|
||||||
<p class="part-day__price_text">за 5 дней пребывания</p>
|
|
||||||
</div>
|
|
||||||
<div class="part-day__price">
|
|
||||||
<div class="block-row">
|
|
||||||
<div class="part-day__price_price">
|
|
||||||
<?php echo number_format($price_half_day, 0, ',', ' '); ?></div>
|
|
||||||
<div class="part-day__price_time non-bg">с 13:30 до 18:30</div>
|
|
||||||
</div>
|
|
||||||
<p class="part-day__price_text">за 5 дней пребывания</p>
|
|
||||||
</div>
|
|
||||||
<div class="block-row">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/calendar.png" width="27" height="28" alt="">
|
|
||||||
<p class="part-day_text">Тематическая неделя на выбор</p>
|
|
||||||
</div>
|
|
||||||
<button class="btn-place btn-write-camp">Занять место</button>
|
|
||||||
<ul>
|
|
||||||
<li><b>5 дней</b> пребывания в клубе</li>
|
|
||||||
<li>творческие занятия и мастер-классы <b>1 раз в день</b></li>
|
|
||||||
<li>умные прогулки <b>1 раз в день</b> (в зависимости от погодные условий)</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="part-day camp-right-part">
|
|
||||||
<div class="part-day_title">
|
|
||||||
<div class="block-row">
|
|
||||||
<p class="part-day_title-text">Полный день</p>
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/star-02.svg" width="30" height="30" alt="">
|
|
||||||
</div>
|
|
||||||
<p class="part-day_text">Пребывание в клубе с утра до вечера, дополнительные активности</p>
|
|
||||||
</div>
|
|
||||||
<div class="part-day__price">
|
|
||||||
<div class="block-row">
|
|
||||||
<div class="part-day__price_price" itemprop="offers" itemscope itemtype="https://schema.org/Offer"><span itemprop="price" content="<?php echo esc_attr($price_full_day); ?>"><?php echo number_format($price_full_day, 0, ',', ' '); ?></span><meta itemprop="priceCurrency" content="RUB"></div>
|
|
||||||
<div class="part-day__price_time non-bg">с 8:30 до 18:30</div>
|
|
||||||
</div>
|
|
||||||
<p class="part-day__price_text">за 5 дней пребывания</p>
|
|
||||||
</div>
|
|
||||||
<div class="block-row">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/calendar+.png" width="27" height="28" alt="">
|
|
||||||
<p class="part-day_text">Тематическая неделя на выбор</p>
|
|
||||||
</div>
|
|
||||||
<button class="btn-place btn-write-camp">Занять место</button>
|
|
||||||
<ul>
|
|
||||||
<li><b>5 дней</b> пребывания в клубе</li>
|
|
||||||
<li>творческие занятия и мастер-классы <b>2 раза в день</b></li>
|
|
||||||
<li>умные прогулки <b>2 раза в день</b> (в зависимости от погодные условий)</li>
|
|
||||||
<li>тематические экскурсии каждую неделю</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg mentors" data-bg="mint">
|
|
||||||
<h2 class="camp_title">Наши наставники и ведущие мастер-классов</h2>
|
|
||||||
<div class="mentors-wrapper">
|
|
||||||
<?php
|
|
||||||
$mentors = carbon_get_post_meta($post_id, 'mentors' );
|
|
||||||
if (is_array($mentors)) {
|
|
||||||
foreach ($mentors as $item) {
|
|
||||||
$mentor = $item['mentor'];
|
|
||||||
$mentorName = get_the_title($mentor[0]['id']);
|
|
||||||
$mentor_job = $item['mentor_job'];
|
|
||||||
$mentor_directions = $item['mentor_directions'];
|
|
||||||
$HTMLdirection = "";
|
|
||||||
$post_url = get_permalink($mentor[0]['id']);
|
|
||||||
if (is_array($mentor_directions)) {
|
|
||||||
foreach ($mentor_directions as $direction) {$HTMLdirection .= "<span>" . esc_html($direction['direction_name'])."</span>";}
|
|
||||||
}
|
|
||||||
$teacher_foto = carbon_get_post_meta($mentor[0]['id'] , 'teacher_avatar');
|
|
||||||
?>
|
|
||||||
<div class="mentors__item">
|
|
||||||
<?php if ( $teacher_foto == '' ) { ?>
|
|
||||||
<img class="mentors__item_img" loading="lazy" width="260" height="270" src="<?php echo get_template_directory_uri(); ?>/assets/images/no-photo.png" alt="">
|
|
||||||
<?php } else { ?>
|
|
||||||
<img class="mentors__item_img" loading="lazy" width="260" height="270" src="<?php echo wp_get_attachment_url($teacher_foto); ?>" alt="<?php echo get_post_meta( $teacher_foto, '_wp_attachment_image_alt', true ); ?>">
|
|
||||||
<?php } ?>
|
|
||||||
<a href="<?php echo esc_url($post_url); ?>" class="mentors__item_name"><?php echo esc_html($mentorName); ?></a>
|
|
||||||
<a href="<?php echo esc_url($post_url); ?>" class="mentors__item_text"><?php echo esc_html($mentor_job); ?></a>
|
|
||||||
<button class="btn-details btn-mentors">Подробнее</button>
|
|
||||||
<div class="mentor-modal-content" style="display: none;">
|
|
||||||
<?php
|
|
||||||
$post_url = get_permalink($mentor[0]['id']);
|
|
||||||
$mentor_education = carbon_get_post_meta($mentor[0]['id'] , 'teacher_education');
|
|
||||||
$mentor_experience = $item['mentor_experience'];
|
|
||||||
$mentor_add_experience = carbon_get_post_meta($mentor[0]['id'] , 'teacher_add_education');
|
|
||||||
?>
|
|
||||||
<div class="HTMLdirection"><?php echo $HTMLdirection; ?></div>
|
|
||||||
<div class="mentor_education"><?php echo esc_html($mentor_education); ?></div>
|
|
||||||
<div class="mentor_experience"><?php echo esc_html($mentor_experience); ?></div>
|
|
||||||
<div class="mentor_add_experience"><?php echo esc_html($mentor_add_experience); ?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php }
|
|
||||||
} ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg routine" data-bg="white">
|
|
||||||
<h2 class="camp_title">Распорядок дня в клубе</h2>
|
|
||||||
<div class="routine-wrapper">
|
|
||||||
<?php
|
|
||||||
$routine = carbon_get_post_meta($post_id, 'routine' );
|
|
||||||
if (is_array($routine)) {
|
|
||||||
foreach ($routine as $item) {
|
|
||||||
$routine_time = $item['routine_time'];
|
|
||||||
$routine_title = $item['routine_title'];
|
|
||||||
$routine_text = $item['routine_text'];
|
|
||||||
?>
|
|
||||||
<div class="routine__item">
|
|
||||||
<div class="routine__item_time"><?php echo esc_html($routine_time); ?></div>
|
|
||||||
<div class="routine__item_circle"></div>
|
|
||||||
<div class="routine__item_text">
|
|
||||||
<p class="routine__item_time-mobile"><?php echo esc_html($routine_time); ?></p>
|
|
||||||
<p class="routine__item_text-title"><?php echo esc_html($routine_title); ?></p>
|
|
||||||
<p class="routine__item_text-text"><?php echo esc_html($routine_text); ?></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php }
|
|
||||||
} ?>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg foto" data-bg="mint">
|
|
||||||
<h2 class="camp_title">Наши фотографии</h2>
|
|
||||||
<div class="camp-foto-wrapper">
|
|
||||||
<?php
|
|
||||||
$fotos = carbon_get_post_meta($post_id, 'fotos' );
|
|
||||||
$fotos_content = carbon_get_post_meta($post_id, 'fotos_content' );
|
|
||||||
$fotos_link_vk = carbon_get_post_meta($post_id, 'fotos_link_vk' );
|
|
||||||
$HTMLimgs = "";
|
|
||||||
if (is_array($fotos)) {
|
|
||||||
foreach ($fotos as $item) {
|
|
||||||
$img = wp_get_attachment_url($item['foto']);
|
|
||||||
$alt = esc_attr(get_post_meta( $item['foto'], '_wp_attachment_image_alt', true ));
|
|
||||||
$HTMLimgs .= "<div class='swiper-slide'>
|
|
||||||
<img loading='lazy' src='$img' alt='$alt' width='560' height='420'>
|
|
||||||
</div>";
|
|
||||||
}
|
|
||||||
} ?>
|
|
||||||
<div class="foto-left-part">
|
|
||||||
<div class="swiper-container camp-swiper-foto">
|
|
||||||
<div class="swiper-wrapper">
|
|
||||||
<?php echo $HTMLimgs; ?>
|
|
||||||
</div>
|
|
||||||
<div class="swiper-button-next"></div>
|
|
||||||
<div class="swiper-button-prev"></div>
|
|
||||||
</div>
|
|
||||||
<div thumbsSlider="" class="swiper-container camp-swiper-foto-thumbsSlider">
|
|
||||||
<div class="swiper-wrapper">
|
|
||||||
<?php echo $HTMLimgs; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="foto-content"><?php echo esc_html($fotos_content); ?></div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg camp-reviews" data-bg="white">
|
|
||||||
<h2 class="camp_title">Что говорят о нас родители</h2>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$key = [
|
|
||||||
[
|
|
||||||
'key' => 'review_type',
|
|
||||||
'value' => 'camp',
|
|
||||||
'compare' => '='
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
?>
|
|
||||||
<div class="camp-reviews-wrapper">
|
|
||||||
<div class="reviews-wrapper">
|
|
||||||
<div class='swiper reviews-owl'>
|
|
||||||
<div class='swiper-wrapper'>
|
|
||||||
<?php
|
|
||||||
$args = array(
|
|
||||||
'posts_per_page' => -1,
|
|
||||||
'post_type' => 'reviews',
|
|
||||||
'orderby' => 'date',
|
|
||||||
'order' => 'DESC',
|
|
||||||
'suppress_filters' => true,
|
|
||||||
'meta_query' => $key,
|
|
||||||
);
|
|
||||||
$the_query = new WP_Query($args);
|
|
||||||
if ($the_query->have_posts()) :
|
|
||||||
while ($the_query->have_posts()) : $the_query->the_post();
|
|
||||||
|
|
||||||
$review_id = get_the_ID();
|
|
||||||
|
|
||||||
$review_date = get_the_date( 'd.m.Y');
|
|
||||||
$review_level = carbon_get_post_meta( $review_id, 'review_level' );
|
|
||||||
|
|
||||||
$avatar = carbon_get_post_meta( $review_id, 'review_avatar' );
|
|
||||||
|
|
||||||
$stars = carbon_get_post_meta( $review_id, 'review_star' );
|
|
||||||
$tekst_otzyva = carbon_get_post_meta( $review_id, 'review_text' );
|
|
||||||
$prepodavatel = carbon_get_post_meta( $review_id, 'review_teacher' );
|
|
||||||
|
|
||||||
$add_class= "more";
|
|
||||||
|
|
||||||
if ( strlen($tekst_otzyva) < 350 ) $add_class= "";
|
|
||||||
|
|
||||||
if ( $tekst_otzyva ) : ?>
|
|
||||||
<div class="swiper-slide reviews__item">
|
|
||||||
<div class="reviews__item-wrapper">
|
|
||||||
<div class="reviews__item-client">
|
|
||||||
<div class="reviews__item-client_avatar" style="background: <?php echo esc_attr(rand_color()); ?>">
|
|
||||||
<?php if ($avatar) : ?>
|
|
||||||
<img loading="lazy" width="57" height="57" class="reviews__item-client_avatar-img" src="<?php echo wp_get_attachment_url($avatar); ?>" alt="<?php echo get_post_meta( $avatar, '_wp_attachment_image_alt', true ); ?>">
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<div class="reviews__item-client_data">
|
|
||||||
<div class="reviews__item-client_name"><?php the_title(); ?></div>
|
|
||||||
<div class="reviews__item-client_lavel" ><?php echo esc_html($review_level); ?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="reviews__item-client_stars">
|
|
||||||
<?php
|
|
||||||
if (!$stars) $stars = 5;
|
|
||||||
for ($i = 1; $i <= $stars; $i++) { ?>
|
|
||||||
<svg width="20" height="20" viewBox="0 0 21 19" fill="none">
|
|
||||||
<path d="M9.58463 1.50884C9.89101 0.602477 11.1729 0.602476 11.4793 1.50884L13.1158 6.35007C13.2531 6.75637 13.6343 7.02985 14.0631 7.02985H19.2721C20.2504 7.02985 20.6467 8.28958 19.8447 8.84971L15.6995 11.7446C15.335 11.9991 15.1823 12.4636 15.3247 12.8847L16.9239 17.6158C17.233 18.5302 16.1954 19.3085 15.404 18.7559L11.1045 15.7533C10.7606 15.5131 10.3033 15.5131 9.95941 15.7533L5.65991 18.7559C4.86857 19.3085 3.83092 18.5302 4.14001 17.6158L5.73926 12.8847C5.8816 12.4636 5.72891 11.9991 5.36448 11.7446L1.21924 8.84971C0.417196 8.28958 0.813532 7.02985 1.79181 7.02985H7.00081C7.42969 7.02985 7.81081 6.75637 7.94815 6.35007L9.58463 1.50884Z" fill="#FFD43E" />
|
|
||||||
</svg>
|
|
||||||
<?php } ?>
|
|
||||||
<span><?php echo esc_html($review_date); ?></span>
|
|
||||||
</div>
|
|
||||||
<div class="reviews__item-client_text <?php echo esc_attr($add_class); ?>">
|
|
||||||
<?php echo wp_kses_post($tekst_otzyva); ?>
|
|
||||||
<button class="btn-more"><span onclick='this.parentNode.parentNode.classList.remove("more")'>... Читать еще</span></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
endif;
|
|
||||||
endwhile; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<div class='custom-button-next reviews-owl-next'></div>
|
|
||||||
<div class='custom-button-prev reviews-owl-prev'></div>
|
|
||||||
<?php wp_reset_postdata(); ?>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<?php getBanner("2", $post_id); ?>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg camp-faq" data-bg="mint">
|
|
||||||
<h2 class="camp_title">Часто задаваемые вопросы</h2>
|
|
||||||
<div class="faq-wrapper" itemscope itemtype="https://schema.org/FAQPage">
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$post_id = get_the_ID();
|
|
||||||
$questions = carbon_get_post_meta($post_id, 'questions' );
|
|
||||||
$HTMcol1 = '';
|
|
||||||
$HTMcol2 = '';
|
|
||||||
|
|
||||||
$count = 0;
|
|
||||||
if (is_array($questions)) {
|
|
||||||
foreach ($questions as $item) {
|
|
||||||
$questions_question = $item['questions_question'];
|
|
||||||
$questions_answer = $item['questions_answer'];
|
|
||||||
$accordion_item = "<div class='box__accordion'>
|
|
||||||
<div class='box__accordion_label' role='button' tabindex='0' itemscope itemprop='mainEntity' itemtype='https://schema.org/Question'>
|
|
||||||
<span itemprop='name'>" . esc_html($questions_question) . "</span>
|
|
||||||
<svg role='presentation' focusable='false' width='24px' height='24px' viewBox='0 0 24 24'>
|
|
||||||
<g stroke='none' stroke-width='2px' fill='none' fill-rule='evenodd' stroke-linecap='square'>
|
|
||||||
<g transform='translate(1.000000, 1.000000)' stroke='#3bb273'>
|
|
||||||
<path d='M0,11 L22,11'></path>
|
|
||||||
<path d='M11,0 L11,22'></path>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
<div class='box__accordion_content' itemscope itemprop='acceptedAnswer' itemtype='https://schema.org/Answer'>
|
|
||||||
<div class='box__accordion_content-text' itemprop='text'>" . wp_kses_post($questions_answer) . "</div>
|
|
||||||
</div>
|
|
||||||
</div>";
|
|
||||||
if ($count % 2 === 0) {
|
|
||||||
$HTMcol1 .= $accordion_item;
|
|
||||||
} else {
|
|
||||||
$HTMcol2 .= $accordion_item;
|
|
||||||
}
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "<div class='accordion'>$HTMcol1</div>";
|
|
||||||
echo "<div class='accordion accordion-last'>$HTMcol2</div>";
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg camp-contact" data-bg="white">
|
|
||||||
<?php
|
|
||||||
$contact_tel = carbon_get_post_meta($post_id, 'contact_tel' );
|
|
||||||
$contact_address = carbon_get_post_meta($post_id, 'contact_address' );
|
|
||||||
$contact_location = carbon_get_post_meta($post_id, 'contact_location' );
|
|
||||||
$contact_location_text = carbon_get_post_meta($post_id, 'contact_location_text' );
|
|
||||||
$contact_mail = carbon_get_post_meta($post_id, 'contact_mail' );
|
|
||||||
?>
|
|
||||||
<h2 class="camp_title">Контакты</h2>
|
|
||||||
<div class="contact-wrapper">
|
|
||||||
<div class="contact-content">
|
|
||||||
<div class="contact_subtitle">Телефон:</div>
|
|
||||||
<a class="contact_tel" href="tel:+<?php echo preg_replace('/[^0-9]/', '', $contact_tel); ?>" target="_blank"><?php echo esc_html($contact_tel); ?></a>
|
|
||||||
<div class="contact_subtitle">Почта:</div>
|
|
||||||
<a class="contact_tel" href="mailto:<?php echo esc_attr($contact_mail); ?>" target="_blank"><?php echo esc_html($contact_mail); ?></a>
|
|
||||||
<div class="contact_subtitle">Адрес:</div>
|
|
||||||
<div class="contact_tel"><?php echo esc_html($contact_address); ?></div>
|
|
||||||
<div class="contact_subtitle">Наши соцсети:</div>
|
|
||||||
<div class="contact_social">
|
|
||||||
<?php
|
|
||||||
$social_media = carbon_get_post_meta( $post_id, 'social_media' );
|
|
||||||
if (is_array($social_media)) {
|
|
||||||
foreach( $social_media as $item ) {
|
|
||||||
$icon = $item['social_media_img'];
|
|
||||||
if ($item['social_media_link'] != '') { ?>
|
|
||||||
<a class="social_item" href="<?php echo esc_url($item['social_media_link']); ?>" title="<?php echo esc_attr($item['social_media_name']); ?>">
|
|
||||||
<img loading="lazy" width="32" height="32" src="<?php echo wp_get_attachment_url($icon); ?>" alt="">
|
|
||||||
</a>
|
|
||||||
<?php }
|
|
||||||
}
|
|
||||||
} ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="contact-map">
|
|
||||||
<div id="ya-map" style="width: 100%; height: 625px;"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<div class="modal-programs" role="dialog" aria-modal="true" aria-label="Программа лагеря">
|
|
||||||
<div class="modal-programs__card">
|
|
||||||
<button class="modal-programs__close btn-close-programs" aria-label="Закрыть">
|
|
||||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M18 6L6 18M6 6l12 12" stroke="#fff" stroke-width="2" stroke-linecap="round"\/><\/svg>
|
|
||||||
</button>
|
|
||||||
<div class="modal-programs__img">
|
|
||||||
<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3C/svg%3E" alt="">
|
|
||||||
</div>
|
|
||||||
<div class="modal-programs__body">
|
|
||||||
<h3 class="programs__item_title"></h3>
|
|
||||||
<p class="programs__item_price"></p>
|
|
||||||
<div class="programs__content"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-mentors" role="dialog" aria-modal="true" aria-label="Информация о наставнике">
|
|
||||||
<div class="modal-mentors-wrapper">
|
|
||||||
<button class="btn-close-mentors" aria-label="Закрыть">
|
|
||||||
<svg role="presentation" class="t-popup__close-icon" width="23px" height="23px" viewBox="0 0 23 23">
|
|
||||||
<g stroke="none" stroke-width="1" fill="#3bb273" fill-rule="evenodd">
|
|
||||||
<rect
|
|
||||||
transform="translate(11.313708, 11.313708) rotate(-45.000000) translate(-11.313708, -11.313708) "
|
|
||||||
x="10.3137085" y="-3.6862915" width="2" height="30"></rect>
|
|
||||||
<rect
|
|
||||||
transform="translate(11.313708, 11.313708) rotate(-315.000000) translate(-11.313708, -11.313708) "
|
|
||||||
x="10.3137085" y="-3.6862915" width="2" height="30"></rect>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
<div class="modal-programs__img">
|
|
||||||
<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3C/svg%3E" alt="">
|
|
||||||
</div>
|
|
||||||
<div class="modal-mentors__content">
|
|
||||||
<div class="modal-mentors_name"></div>
|
|
||||||
<div class="modal-mentors_job"></div>
|
|
||||||
<div class="modal-mentors__directions"></div>
|
|
||||||
<div class="modal-mentors__about">
|
|
||||||
<div class="about-item">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/icons/icon-education.svg" alt="" width="60" height="58" loading="lazy">
|
|
||||||
<div class="mentors__about-col">
|
|
||||||
<p class="mentors__about-col_title">Образование:</p>
|
|
||||||
<div class="mentors__about-col_text"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="about-item">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/icons/icon-experience.svg" alt="" width="59" height="58" loading="lazy">
|
|
||||||
<div class="mentors__about-col">
|
|
||||||
<p class="mentors__about-col_title">Опыт работы в сфере образования:</p>
|
|
||||||
<div class="mentors__experience-col_text"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-additional__education">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/icons/icon-certificate.svg" alt="" width="58" height="60" loading="lazy">
|
|
||||||
<div class="mentors__about-col">
|
|
||||||
<p class="mentors__about-col_title">Дополнительное образование:</p>
|
|
||||||
<div class="modal-additional__education_list">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-camp-request-form" style="display: none;">
|
|
||||||
<div class="form-wrapper">
|
|
||||||
<button class="btn-close-request-form">
|
|
||||||
<img class="btn-close-request-form-camp" src="<?php echo get_template_directory_uri(); ?>/assets/images/btn-close-modal.svg" alt="кнопка закрыть окно">
|
|
||||||
</button>
|
|
||||||
<?php echo carbon_get_post_meta($post_id, 'camp_bitrix_script' ); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
(function() {
|
|
||||||
var mapLoaded = false;
|
|
||||||
var mapContainer = document.getElementById("ya-map");
|
|
||||||
if (!mapContainer) return;
|
|
||||||
|
|
||||||
var observer = new IntersectionObserver(function(entries) {
|
|
||||||
if (entries[0].isIntersecting && !mapLoaded) {
|
|
||||||
mapLoaded = true;
|
|
||||||
observer.disconnect();
|
|
||||||
|
|
||||||
var script = document.createElement("script");
|
|
||||||
script.src = "https://api-maps.yandex.ru/2.1/?lang=ru_RU";
|
|
||||||
script.onload = function() {
|
|
||||||
script.onerror = function() { console.warn("Yandex Maps API failed to load"); };
|
|
||||||
ymaps.ready(function() {
|
|
||||||
var coords = <?php echo $contact_location ? '[' . esc_js($contact_location) . ']' : '[55.76, 37.64]'; ?>;
|
|
||||||
var map = new ymaps.Map("ya-map", {
|
|
||||||
center: coords,
|
|
||||||
zoom: 16
|
|
||||||
}, {
|
|
||||||
searchControlProvider: "yandex#search"
|
|
||||||
});
|
|
||||||
|
|
||||||
var placemark = new ymaps.Placemark(
|
|
||||||
coords,
|
|
||||||
{ iconContent: "<?php echo esc_js($contact_location_text); ?>" },
|
|
||||||
{ preset: "islands#redStretchyIcon" }
|
|
||||||
);
|
|
||||||
map.geoObjects.add(placemark);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
document.body.appendChild(script);
|
|
||||||
}
|
|
||||||
}, { rootMargin: "200px" });
|
|
||||||
|
|
||||||
observer.observe(mapContainer);
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
|
||||||
get_footer();
|
|
||||||
@ -1,769 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
Template Name: Шаблон страницы Лагерь
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
get_header();
|
|
||||||
$post_id = get_the_ID();
|
|
||||||
|
|
||||||
$priceMin = 1000000;
|
|
||||||
$programs = carbon_get_post_meta($post_id, 'programs' );
|
|
||||||
|
|
||||||
if (is_array($programs)) {
|
|
||||||
foreach ($programs as $item) {
|
|
||||||
$price = (int)$item['programs_price'];
|
|
||||||
if ($price < $priceMin) $priceMin = $price;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Banner helper
|
|
||||||
*/
|
|
||||||
function getBanner($suffix, $post_id) {
|
|
||||||
$img = carbon_get_post_meta($post_id, 'banner_add_img' . $suffix);
|
|
||||||
$img_url = $img ? wp_get_attachment_url($img) : '';
|
|
||||||
if (!$img_url) return;
|
|
||||||
$title = carbon_get_post_meta($post_id, 'banner_add_title' . $suffix);
|
|
||||||
$text = carbon_get_post_meta($post_id, 'banner_add_text' . $suffix);
|
|
||||||
$note = carbon_get_post_meta($post_id, 'banner_add_text_min' . $suffix);
|
|
||||||
?>
|
|
||||||
<div class='banner banner-add' style='background-image: url(<?php echo esc_url($img_url); ?>)'>
|
|
||||||
<div class='banner__left-part'>
|
|
||||||
<div class='banner_title'><?php echo esc_html($title); ?></div>
|
|
||||||
<p class='banner_text'><?php echo esc_html($text); ?></p>
|
|
||||||
<button class='banner_btn btn-write-camp'><?php esc_html_e('ЗАБРОНИРОВАТЬ'); ?></button>
|
|
||||||
<p class='banner_text-min'><?php echo esc_html($note); ?></p>
|
|
||||||
</div>
|
|
||||||
<div class='banner__right-part'></div>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<main class="camp container_camp">
|
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* === Все данные из Carbon Fields собираем в одном месте ===
|
|
||||||
*/
|
|
||||||
$hero = [
|
|
||||||
'h1' => 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' => get_template_directory_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' => get_template_directory_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' => get_template_directory_uri() . '/assets/images/doodles/icon-award.png',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<section class="section-bg hero-media-search" data-bg="hero">
|
|
||||||
<div class="container">
|
|
||||||
<div class="hero-media-search__container">
|
|
||||||
|
|
||||||
<!-- Левая колонка -->
|
|
||||||
<div class="hero-media-search__content">
|
|
||||||
<h1 class="heading-1"><?php echo wp_kses_post( $hero['h1'] ); ?></h1>
|
|
||||||
<h2 class="hero-subtitle-brand"><?php echo wp_kses_post( $hero['span'] ); ?></h2>
|
|
||||||
|
|
||||||
<!-- Метрики (десктоп) -->
|
|
||||||
<div class="hero-media-search__propositions on-desktop">
|
|
||||||
<?php foreach ( $metrics as $metric ) : ?>
|
|
||||||
<?php render_hero_metric( $metric ); ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- CTA (десктоп) -->
|
|
||||||
<div class="hero-cta on-desktop">
|
|
||||||
<a href="#" class="btn-write-camp about-us__cta-link" aria-label="<?php echo esc_attr( $hero['btn_text'] ); ?>">
|
|
||||||
<?php echo esc_html( $hero['btn_text'] ); ?> →
|
|
||||||
</a>
|
|
||||||
<p class="hero-cta__note">Один пробный день — за наш счёт. Оцените качество сами, а решение примете после.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Правая колонка (изображение + мобильные элементы) -->
|
|
||||||
<div class="hero-media-search__media">
|
|
||||||
<div class="hero-media-search__frame">
|
|
||||||
<?php if ( $hero['image_id'] ) : ?>
|
|
||||||
<?php echo wp_get_attachment_image( $hero['image_id'], 'full', false, [
|
|
||||||
'class' => 'hero-media-search__image',
|
|
||||||
'fetchpriority' => 'high',
|
|
||||||
'loading' => 'eager',
|
|
||||||
'alt' => esc_attr( wp_trim_words( $hero['h1'], 10 ) )
|
|
||||||
] ); ?>
|
|
||||||
<?php else : ?>
|
|
||||||
<img class="hero-media-search__image"
|
|
||||||
fetchpriority="high" src="<?php echo get_template_directory_uri(); ?>/assets/images/camp-hero.jpg"
|
|
||||||
alt="Детский лагерь Декарт" loading="eager">
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<!-- Декоративные элементы -->
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/doodles/hero-doodle-gears.svg"
|
|
||||||
alt="" class="doodle doodle--top-left">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/doodles/hero-doodle-pencils.svg"
|
|
||||||
alt="" class="doodle doodle--bottom-right">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Метрики + CTA (мобильная версия) -->
|
|
||||||
<div class="hero-media-search__wrapper">
|
|
||||||
<div class="hero-media-search__propositions on-mobile">
|
|
||||||
<?php foreach ( $metrics as $metric ) : ?>
|
|
||||||
<?php render_hero_metric( $metric ); ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="hero-cta on-mobile">
|
|
||||||
<a href="#0" class="btn-write-camp about-us__cta-link" aria-label="<?php echo esc_attr( $hero['btn_text'] ); ?>">
|
|
||||||
<?php echo esc_html( $hero['btn_text'] ); ?> →
|
|
||||||
</a>
|
|
||||||
<p class="hero-cta__note">Один пробный день — за наш счёт. Оцените качество сами, а решение примете после.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="section-reveal section-bg about-us" data-bg="white">
|
|
||||||
<div class="container">
|
|
||||||
<div class="about-us__wrapper">
|
|
||||||
<div class="about-us__image-col">
|
|
||||||
<div class="about-us__frame">
|
|
||||||
<?php
|
|
||||||
$about_img_id = carbon_get_post_meta( $post_id, 'about_us_img' );
|
|
||||||
if ( $about_img_id ) :
|
|
||||||
echo wp_get_attachment_image( $about_img_id, 'large', false, [
|
|
||||||
'class' => 'about-us__image',
|
|
||||||
'loading' => 'lazy',
|
|
||||||
'alt' => 'Фото детского лагеря Декарт'
|
|
||||||
] );
|
|
||||||
else :
|
|
||||||
echo '<div class="about-us__image-placeholder">
|
|
||||||
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
||||||
<rect x="3" y="3" width="18" height="18" rx="2"/>
|
|
||||||
<circle cx="8.5" cy="8.5" r="1.5"/>
|
|
||||||
<path d="M21 15l-5-5L5 21"/>
|
|
||||||
</svg>
|
|
||||||
<span>Добавьте фото</span>
|
|
||||||
</div>';
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/doodles/galileo/paperplane-galileo.svg"
|
|
||||||
alt="" class="about-us__doodle about-us__doodle--plane">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/doodles/galileo/orangegear-white.svg"
|
|
||||||
alt="" class="about-us__doodle about-us__doodle--heart">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="about-us__content-col">
|
|
||||||
<h2 class="camp_title about-us__title">Лето, которое не хочется ставить на паузу</h2>
|
|
||||||
<div class="about-us__text">
|
|
||||||
<?php echo wp_kses_post( carbon_get_post_meta( $post_id, 'about_us_text' ) ?: 'Всю зиму ребёнок в телефоне? Бабушка устала? А ведь лето может быть другим — ярким, живым, полезным.
|
|
||||||
В Dekart дети не просто под присмотром. Они собирают роботов, ставят опыты, играют в театре, бегают на квестах и находят друзей.А главное — бегут в лагерь каждое утро без уговоров.' ); ?>
|
|
||||||
</div>
|
|
||||||
<div class="about-us__social-proof">
|
|
||||||
<span class="about-us__badge">⭐ 2500+ мам доверили нам лето</span>
|
|
||||||
</div>
|
|
||||||
<div class="about-us__cta">
|
|
||||||
<a href="#" class="btn-write-camp about-us__cta-link">Хочу на пробный день →</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="section-reveal section-bg suggestions" data-bg="mint">
|
|
||||||
<div class="container">
|
|
||||||
<h2 class="camp_title">Почему мамы выбирают Dekart: дети бегут сюда сами</h2>
|
|
||||||
<p class="suggestions__subtitle">Никаких уговоров по утрам. Никаких «забери меня». Только горящие глаза и «а можно ещё?»</p>
|
|
||||||
<div class="suggestions-wrapper"> <?php $suggestions = carbon_get_post_meta($post_id, 'suggestions' ); $icons = ['innovation-white.svg', 'steamprojects-35x35-1.svg', 'handson-35x35-1.svg', 'orangegear-white.svg', 'outdoor-white.svg', 'heart_sticker.svg'];
|
|
||||||
if (is_array($suggestions)) {
|
|
||||||
foreach ($suggestions as $index => $item) {
|
|
||||||
$suggestions_title = $item['suggestions_title'];
|
|
||||||
$suggestions_text = $item['suggestions_text'];
|
|
||||||
$icon_file = $icons[$index % count($icons)];
|
|
||||||
?> <div class="suggestions__item">
|
|
||||||
<div class="suggestions__icon-wrap">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/doodles/galileo/<?php echo $icon_file; ?>"
|
|
||||||
alt="" class="suggestions__icon">
|
|
||||||
</div>
|
|
||||||
<h3 class="suggestions__item_title"><?php echo esc_html( $suggestions_title ); ?></h3>
|
|
||||||
<p class="suggestions__item_text"><?php echo esc_html( $suggestions_text ); ?></p>
|
|
||||||
</div> <?php }
|
|
||||||
} ?> </div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="section-reveal section-bg infograph" data-bg="white">
|
|
||||||
<div class="container">
|
|
||||||
<h2 class="camp_title">Цифры, которые говорят сами за себя</h2>
|
|
||||||
<p class="infograph__lead">Мы создаём среду, где каждый ребёнок раскрывает свой потенциал</p>
|
|
||||||
<div class="infograph__grid">
|
|
||||||
|
|
||||||
<div class="infograph__card">
|
|
||||||
<div class="infograph__icon infograph__icon--age">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/age.svg" alt="" width="48" height="48">
|
|
||||||
</div>
|
|
||||||
<p class="infograph__stat">6,5−11 лет</p>
|
|
||||||
<p class="infograph__label">возраст</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="infograph__card">
|
|
||||||
<div class="infograph__icon infograph__icon--group">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/group.svg" alt="" width="48" height="48">
|
|
||||||
</div>
|
|
||||||
<p class="infograph__stat">до 10 детей</p>
|
|
||||||
<p class="infograph__label">каждая группа</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="infograph__card">
|
|
||||||
<div class="infograph__icon infograph__icon--time">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/time.svg" alt="" width="48" height="48">
|
|
||||||
</div>
|
|
||||||
<p class="infograph__stat">на выбор</p>
|
|
||||||
<p class="infograph__label">время посещения</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="infograph__card">
|
|
||||||
<div class="infograph__icon infograph__icon--price">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/price.svg" alt="" width="48" height="48">
|
|
||||||
</div>
|
|
||||||
<p class="infograph__stat">от <?php echo esc_html( number_format($priceMin, 0, ',', ' ') ); ?> ₽</p>
|
|
||||||
<p class="infograph__label">стоимость недели</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg programs" data-bg="mint" itemscope itemtype="https://schema.org/ItemList">
|
|
||||||
<div class="container">
|
|
||||||
<h2 class="camp_title" itemprop="name">Летние программы</h2>
|
|
||||||
<div class="programs__grid">
|
|
||||||
<?php
|
|
||||||
$programs = carbon_get_post_meta($post_id, 'programs');
|
|
||||||
if (is_array($programs)) {
|
|
||||||
foreach ($programs as $item) {
|
|
||||||
$programs_img = $item['programs_img'];
|
|
||||||
$programs_title = $item['programs_title'];
|
|
||||||
$programs_date = $item['programs_date'];
|
|
||||||
$programs_text = $item['programs_text'];
|
|
||||||
$programs_price = $item['programs_price'];
|
|
||||||
$programs_days = $item['programs_days'];
|
|
||||||
$programs_content = $item['programs_content'];?>
|
|
||||||
<article class="programs__card">
|
|
||||||
<img class="programs__image" loading="lazy" width="360" height="225" src="<?php echo wp_get_attachment_url($programs_img); ?>" alt="<?php echo get_post_meta($programs_img, '_wp_attachment_image_alt', true); ?>">
|
|
||||||
<div class="programs__body">
|
|
||||||
<h3 class="programs__name"><?php echo esc_html($programs_title); ?></h3>
|
|
||||||
<p class="programs__date"><?php echo esc_html($programs_date); ?></p>
|
|
||||||
<p class="programs__desc"><?php echo esc_html($programs_text); ?></p>
|
|
||||||
<div class="programs__footer">
|
|
||||||
<span class="programs__price"><?php echo number_format((int)$programs_price, 0, ',', ' '); ?> ₽</span>
|
|
||||||
<span class="programs__duration"><?php echo esc_html($programs_days); ?></span>
|
|
||||||
</div>
|
|
||||||
<div class="programs_content" style="display: none;"><?php echo wp_kses_post($programs_content); ?></div>
|
|
||||||
<button class="programs__btn btn-program" aria-label="Подробнее о программе <?php echo esc_attr($programs_title); ?>">Подробнее</button>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
} ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<?php getBanner('', $post_id); ?>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg bring-child" data-bg="white" itemscope itemtype="https://schema.org/Product">
|
|
||||||
<meta itemprop="name" content="Городской лагерь Декарт">
|
|
||||||
<meta itemprop="description" content="Стоимость пребывания в городском лагере Декарт">
|
|
||||||
<?php
|
|
||||||
$price_half_day = carbon_get_post_meta($post_id, 'price_half_day' );
|
|
||||||
$price_full_day = carbon_get_post_meta($post_id, 'price_full_day' );
|
|
||||||
?>
|
|
||||||
<h2 class="camp_title">Приводите ребёнка, когда вам удобно</h2>
|
|
||||||
<div class="bring-child-wrapper">
|
|
||||||
<div class="part-day camp-left-part">
|
|
||||||
<div class="part-day_title">
|
|
||||||
<div class="block-row">
|
|
||||||
<p class="part-day_title-text">Половина дня</p>
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/green-star.svg" width="30" height="30" alt="">
|
|
||||||
</div>
|
|
||||||
<p class="part-day_text">Время пребывания — на выбор (до обеда или до вечера)</p>
|
|
||||||
</div>
|
|
||||||
<div class="part-day__price">
|
|
||||||
<div class="block-row">
|
|
||||||
<div class="part-day__price_price" itemprop="offers" itemscope itemtype="https://schema.org/Offer"><span itemprop="price" content="<?php echo esc_attr($price_half_day); ?>"><?php echo number_format($price_half_day, 0, ',', ' '); ?></span><meta itemprop="priceCurrency" content="RUB"></div>
|
|
||||||
<div class="part-day__price_time">с 8:30 до 13:30</div>
|
|
||||||
</div>
|
|
||||||
<p class="part-day__price_text">за 5 дней пребывания</p>
|
|
||||||
</div>
|
|
||||||
<div class="part-day__price">
|
|
||||||
<div class="block-row">
|
|
||||||
<div class="part-day__price_price">
|
|
||||||
<?php echo number_format($price_half_day, 0, ',', ' '); ?></div>
|
|
||||||
<div class="part-day__price_time non-bg">с 13:30 до 18:30</div>
|
|
||||||
</div>
|
|
||||||
<p class="part-day__price_text">за 5 дней пребывания</p>
|
|
||||||
</div>
|
|
||||||
<div class="block-row">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/calendar.png" width="27" height="28" alt="">
|
|
||||||
<p class="part-day_text">Тематическая неделя на выбор</p>
|
|
||||||
</div>
|
|
||||||
<button class="btn-place btn-write-camp">Занять место</button>
|
|
||||||
<ul>
|
|
||||||
<li><b>5 дней</b> пребывания в клубе</li>
|
|
||||||
<li>творческие занятия и мастер-классы <b>1 раз в день</b></li>
|
|
||||||
<li>умные прогулки <b>1 раз в день</b> (в зависимости от погодные условий)</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="part-day camp-right-part">
|
|
||||||
<div class="part-day_title">
|
|
||||||
<div class="block-row">
|
|
||||||
<p class="part-day_title-text">Полный день</p>
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/star-02.svg" width="30" height="30" alt="">
|
|
||||||
</div>
|
|
||||||
<p class="part-day_text">Пребывание в клубе с утра до вечера, дополнительные активности</p>
|
|
||||||
</div>
|
|
||||||
<div class="part-day__price">
|
|
||||||
<div class="block-row">
|
|
||||||
<div class="part-day__price_price" itemprop="offers" itemscope itemtype="https://schema.org/Offer"><span itemprop="price" content="<?php echo esc_attr($price_full_day); ?>"><?php echo number_format($price_full_day, 0, ',', ' '); ?></span><meta itemprop="priceCurrency" content="RUB"></div>
|
|
||||||
<div class="part-day__price_time non-bg">с 8:30 до 18:30</div>
|
|
||||||
</div>
|
|
||||||
<p class="part-day__price_text">за 5 дней пребывания</p>
|
|
||||||
</div>
|
|
||||||
<div class="block-row">
|
|
||||||
<img loading="lazy" src="<?php echo get_template_directory_uri(); ?>/assets/images/calendar+.png" width="27" height="28" alt="">
|
|
||||||
<p class="part-day_text">Тематическая неделя на выбор</p>
|
|
||||||
</div>
|
|
||||||
<button class="btn-place btn-write-camp">Занять место</button>
|
|
||||||
<ul>
|
|
||||||
<li><b>5 дней</b> пребывания в клубе</li>
|
|
||||||
<li>творческие занятия и мастер-классы <b>2 раза в день</b></li>
|
|
||||||
<li>умные прогулки <b>2 раза в день</b> (в зависимости от погодные условий)</li>
|
|
||||||
<li>тематические экскурсии каждую неделю</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg mentors" data-bg="mint">
|
|
||||||
<h2 class="camp_title">Наши наставники и ведущие мастер-классов</h2>
|
|
||||||
<div class="mentors-wrapper">
|
|
||||||
<?php
|
|
||||||
$mentors = carbon_get_post_meta($post_id, 'mentors' );
|
|
||||||
if (is_array($mentors)) {
|
|
||||||
foreach ($mentors as $item) {
|
|
||||||
$mentor = $item['mentor'];
|
|
||||||
$mentorName = get_the_title($mentor[0]['id']);
|
|
||||||
$mentor_job = $item['mentor_job'];
|
|
||||||
$mentor_directions = $item['mentor_directions'];
|
|
||||||
$HTMLdirection = "";
|
|
||||||
$post_url = get_permalink($mentor[0]['id']);
|
|
||||||
if (is_array($mentor_directions)) {
|
|
||||||
foreach ($mentor_directions as $direction) {$HTMLdirection .= "<span>" . esc_html($direction['direction_name'])."</span>";}
|
|
||||||
}
|
|
||||||
$teacher_foto = carbon_get_post_meta($mentor[0]['id'] , 'teacher_avatar');
|
|
||||||
?>
|
|
||||||
<div class="mentors__item">
|
|
||||||
<?php if ( $teacher_foto == '' ) { ?>
|
|
||||||
<img class="mentors__item_img" loading="lazy" width="260" height="270" src="<?php echo get_template_directory_uri(); ?>/assets/images/no-photo.png" alt="">
|
|
||||||
<?php } else { ?>
|
|
||||||
<img class="mentors__item_img" loading="lazy" width="260" height="270" src="<?php echo wp_get_attachment_url($teacher_foto); ?>" alt="<?php echo get_post_meta( $teacher_foto, '_wp_attachment_image_alt', true ); ?>">
|
|
||||||
<?php } ?>
|
|
||||||
<a href="<?php echo esc_url($post_url); ?>" class="mentors__item_name"><?php echo esc_html($mentorName); ?></a>
|
|
||||||
<a href="<?php echo esc_url($post_url); ?>" class="mentors__item_text"><?php echo esc_html($mentor_job); ?></a>
|
|
||||||
<button class="btn-details btn-mentors">Подробнее</button>
|
|
||||||
<div class="mentor-modal-content" style="display: none;">
|
|
||||||
<?php
|
|
||||||
$post_url = get_permalink($mentor[0]['id']);
|
|
||||||
$mentor_education = carbon_get_post_meta($mentor[0]['id'] , 'teacher_education');
|
|
||||||
$mentor_experience = $item['mentor_experience'];
|
|
||||||
$mentor_add_experience = carbon_get_post_meta($mentor[0]['id'] , 'teacher_add_education');
|
|
||||||
?>
|
|
||||||
<div class="HTMLdirection"><?php echo $HTMLdirection; ?></div>
|
|
||||||
<div class="mentor_education"><?php echo esc_html($mentor_education); ?></div>
|
|
||||||
<div class="mentor_experience"><?php echo esc_html($mentor_experience); ?></div>
|
|
||||||
<div class="mentor_add_experience"><?php echo esc_html($mentor_add_experience); ?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php }
|
|
||||||
} ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg routine" data-bg="white">
|
|
||||||
<h2 class="camp_title">Распорядок дня в клубе</h2>
|
|
||||||
<div class="routine-wrapper">
|
|
||||||
<?php
|
|
||||||
$routine = carbon_get_post_meta($post_id, 'routine' );
|
|
||||||
if (is_array($routine)) {
|
|
||||||
foreach ($routine as $item) {
|
|
||||||
$routine_time = $item['routine_time'];
|
|
||||||
$routine_title = $item['routine_title'];
|
|
||||||
$routine_text = $item['routine_text'];
|
|
||||||
?>
|
|
||||||
<div class="routine__item">
|
|
||||||
<div class="routine__item_time"><?php echo esc_html($routine_time); ?></div>
|
|
||||||
<div class="routine__item_circle"></div>
|
|
||||||
<div class="routine__item_text">
|
|
||||||
<p class="routine__item_time-mobile"><?php echo esc_html($routine_time); ?></p>
|
|
||||||
<p class="routine__item_text-title"><?php echo esc_html($routine_title); ?></p>
|
|
||||||
<p class="routine__item_text-text"><?php echo esc_html($routine_text); ?></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php }
|
|
||||||
} ?>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg foto" data-bg="mint">
|
|
||||||
<h2 class="camp_title">Наши фотографии</h2>
|
|
||||||
<div class="camp-foto-wrapper">
|
|
||||||
<?php
|
|
||||||
$fotos = carbon_get_post_meta($post_id, 'fotos' );
|
|
||||||
$fotos_content = carbon_get_post_meta($post_id, 'fotos_content' );
|
|
||||||
$fotos_link_vk = carbon_get_post_meta($post_id, 'fotos_link_vk' );
|
|
||||||
$HTMLimgs = "";
|
|
||||||
if (is_array($fotos)) {
|
|
||||||
foreach ($fotos as $item) {
|
|
||||||
$img = wp_get_attachment_url($item['foto']);
|
|
||||||
$alt = esc_attr(get_post_meta( $item['foto'], '_wp_attachment_image_alt', true ));
|
|
||||||
$HTMLimgs .= "<div class='swiper-slide'>
|
|
||||||
<img loading='lazy' src='$img' alt='$alt' width='560' height='420'>
|
|
||||||
</div>";
|
|
||||||
}
|
|
||||||
} ?>
|
|
||||||
<div class="foto-left-part">
|
|
||||||
<div class="swiper-container camp-swiper-foto">
|
|
||||||
<div class="swiper-wrapper">
|
|
||||||
<?php echo $HTMLimgs; ?>
|
|
||||||
</div>
|
|
||||||
<div class="swiper-button-next"></div>
|
|
||||||
<div class="swiper-button-prev"></div>
|
|
||||||
</div>
|
|
||||||
<div thumbsSlider="" class="swiper-container camp-swiper-foto-thumbsSlider">
|
|
||||||
<div class="swiper-wrapper">
|
|
||||||
<?php echo $HTMLimgs; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="foto-content"><?php echo esc_html($fotos_content); ?></div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg camp-reviews" data-bg="white">
|
|
||||||
<h2 class="camp_title">Что говорят о нас родители</h2>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$key = [
|
|
||||||
[
|
|
||||||
'key' => 'review_type',
|
|
||||||
'value' => 'camp',
|
|
||||||
'compare' => '='
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
?>
|
|
||||||
<div class="camp-reviews-wrapper">
|
|
||||||
<div class="reviews-wrapper">
|
|
||||||
<div class='swiper reviews-owl'>
|
|
||||||
<div class='swiper-wrapper'>
|
|
||||||
<?php
|
|
||||||
$args = array(
|
|
||||||
'posts_per_page' => -1,
|
|
||||||
'post_type' => 'reviews',
|
|
||||||
'orderby' => 'date',
|
|
||||||
'order' => 'DESC',
|
|
||||||
'suppress_filters' => true,
|
|
||||||
'meta_query' => $key,
|
|
||||||
);
|
|
||||||
$the_query = new WP_Query($args);
|
|
||||||
if ($the_query->have_posts()) :
|
|
||||||
while ($the_query->have_posts()) : $the_query->the_post();
|
|
||||||
|
|
||||||
$review_id = get_the_ID();
|
|
||||||
|
|
||||||
$review_date = get_the_date( 'd.m.Y');
|
|
||||||
$review_level = carbon_get_post_meta( $review_id, 'review_level' );
|
|
||||||
|
|
||||||
$avatar = carbon_get_post_meta( $review_id, 'review_avatar' );
|
|
||||||
|
|
||||||
$stars = carbon_get_post_meta( $review_id, 'review_star' );
|
|
||||||
$tekst_otzyva = carbon_get_post_meta( $review_id, 'review_text' );
|
|
||||||
$prepodavatel = carbon_get_post_meta( $review_id, 'review_teacher' );
|
|
||||||
|
|
||||||
$add_class= "more";
|
|
||||||
|
|
||||||
if ( strlen($tekst_otzyva) < 350 ) $add_class= "";
|
|
||||||
|
|
||||||
if ( $tekst_otzyva ) : ?>
|
|
||||||
<div class="swiper-slide reviews__item">
|
|
||||||
<div class="reviews__item-wrapper">
|
|
||||||
<div class="reviews__item-client">
|
|
||||||
<div class="reviews__item-client_avatar" style="background: <?php echo esc_attr(rand_color()); ?>">
|
|
||||||
<?php if ($avatar) : ?>
|
|
||||||
<img loading="lazy" width="57" height="57" class="reviews__item-client_avatar-img" src="<?php echo wp_get_attachment_url($avatar); ?>" alt="<?php echo get_post_meta( $avatar, '_wp_attachment_image_alt', true ); ?>">
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<div class="reviews__item-client_data">
|
|
||||||
<div class="reviews__item-client_name"><?php the_title(); ?></div>
|
|
||||||
<div class="reviews__item-client_lavel" ><?php echo esc_html($review_level); ?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="reviews__item-client_stars">
|
|
||||||
<?php
|
|
||||||
if (!$stars) $stars = 5;
|
|
||||||
for ($i = 1; $i <= $stars; $i++) { ?>
|
|
||||||
<svg width="20" height="20" viewBox="0 0 21 19" fill="none">
|
|
||||||
<path d="M9.58463 1.50884C9.89101 0.602477 11.1729 0.602476 11.4793 1.50884L13.1158 6.35007C13.2531 6.75637 13.6343 7.02985 14.0631 7.02985H19.2721C20.2504 7.02985 20.6467 8.28958 19.8447 8.84971L15.6995 11.7446C15.335 11.9991 15.1823 12.4636 15.3247 12.8847L16.9239 17.6158C17.233 18.5302 16.1954 19.3085 15.404 18.7559L11.1045 15.7533C10.7606 15.5131 10.3033 15.5131 9.95941 15.7533L5.65991 18.7559C4.86857 19.3085 3.83092 18.5302 4.14001 17.6158L5.73926 12.8847C5.8816 12.4636 5.72891 11.9991 5.36448 11.7446L1.21924 8.84971C0.417196 8.28958 0.813532 7.02985 1.79181 7.02985H7.00081C7.42969 7.02985 7.81081 6.75637 7.94815 6.35007L9.58463 1.50884Z" fill="#FFD43E" />
|
|
||||||
</svg>
|
|
||||||
<?php } ?>
|
|
||||||
<span><?php echo esc_html($review_date); ?></span>
|
|
||||||
</div>
|
|
||||||
<div class="reviews__item-client_text <?php echo esc_attr($add_class); ?>">
|
|
||||||
<?php echo wp_kses_post($tekst_otzyva); ?>
|
|
||||||
<button class="btn-more"><span onclick='this.parentNode.parentNode.classList.remove("more")'>... Читать еще</span></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
endif;
|
|
||||||
endwhile; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<div class='custom-button-next reviews-owl-next'></div>
|
|
||||||
<div class='custom-button-prev reviews-owl-prev'></div>
|
|
||||||
<?php wp_reset_postdata(); ?>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<?php getBanner("2", $post_id); ?>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg camp-faq" data-bg="mint">
|
|
||||||
<h2 class="camp_title">Часто задаваемые вопросы</h2>
|
|
||||||
<div class="faq-wrapper" itemscope itemtype="https://schema.org/FAQPage">
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$post_id = get_the_ID();
|
|
||||||
$questions = carbon_get_post_meta($post_id, 'questions' );
|
|
||||||
$HTMcol1 = '';
|
|
||||||
$HTMcol2 = '';
|
|
||||||
|
|
||||||
$count = 0;
|
|
||||||
if (is_array($questions)) {
|
|
||||||
foreach ($questions as $item) {
|
|
||||||
$questions_question = $item['questions_question'];
|
|
||||||
$questions_answer = $item['questions_answer'];
|
|
||||||
$accordion_item = "<div class='box__accordion'>
|
|
||||||
<div class='box__accordion_label' role='button' tabindex='0' itemscope itemprop='mainEntity' itemtype='https://schema.org/Question'>
|
|
||||||
<span itemprop='name'>" . esc_html($questions_question) . "</span>
|
|
||||||
<svg role='presentation' focusable='false' width='24px' height='24px' viewBox='0 0 24 24'>
|
|
||||||
<g stroke='none' stroke-width='2px' fill='none' fill-rule='evenodd' stroke-linecap='square'>
|
|
||||||
<g transform='translate(1.000000, 1.000000)' stroke='#3bb273'>
|
|
||||||
<path d='M0,11 L22,11'></path>
|
|
||||||
<path d='M11,0 L11,22'></path>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
<div class='box__accordion_content' itemscope itemprop='acceptedAnswer' itemtype='https://schema.org/Answer'>
|
|
||||||
<div class='box__accordion_content-text' itemprop='text'>" . wp_kses_post($questions_answer) . "</div>
|
|
||||||
</div>
|
|
||||||
</div>";
|
|
||||||
if ($count % 2 === 0) {
|
|
||||||
$HTMcol1 .= $accordion_item;
|
|
||||||
} else {
|
|
||||||
$HTMcol2 .= $accordion_item;
|
|
||||||
}
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "<div class='accordion'>$HTMcol1</div>";
|
|
||||||
echo "<div class='accordion accordion-last'>$HTMcol2</div>";
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="section-reveal section-bg camp-contact" data-bg="white">
|
|
||||||
<?php
|
|
||||||
$contact_tel = carbon_get_post_meta($post_id, 'contact_tel' );
|
|
||||||
$contact_address = carbon_get_post_meta($post_id, 'contact_address' );
|
|
||||||
$contact_location = carbon_get_post_meta($post_id, 'contact_location' );
|
|
||||||
$contact_location_text = carbon_get_post_meta($post_id, 'contact_location_text' );
|
|
||||||
$contact_mail = carbon_get_post_meta($post_id, 'contact_mail' );
|
|
||||||
?>
|
|
||||||
<h2 class="camp_title">Контакты</h2>
|
|
||||||
<div class="contact-wrapper">
|
|
||||||
<div class="contact-content">
|
|
||||||
<div class="contact_subtitle">Телефон:</div>
|
|
||||||
<a class="contact_tel" href="tel:+<?php echo preg_replace('/[^0-9]/', '', $contact_tel); ?>" target="_blank"><?php echo esc_html($contact_tel); ?></a>
|
|
||||||
<div class="contact_subtitle">Почта:</div>
|
|
||||||
<a class="contact_tel" href="mailto:<?php echo esc_attr($contact_mail); ?>" target="_blank"><?php echo esc_html($contact_mail); ?></a>
|
|
||||||
<div class="contact_subtitle">Адрес:</div>
|
|
||||||
<div class="contact_tel"><?php echo esc_html($contact_address); ?></div>
|
|
||||||
<div class="contact_subtitle">Наши соцсети:</div>
|
|
||||||
<div class="contact_social">
|
|
||||||
<?php
|
|
||||||
$social_media = carbon_get_post_meta( $post_id, 'social_media' );
|
|
||||||
if (is_array($social_media)) {
|
|
||||||
foreach( $social_media as $item ) {
|
|
||||||
$icon = $item['social_media_img'];
|
|
||||||
if ($item['social_media_link'] != '') { ?>
|
|
||||||
<a class="social_item" href="<?php echo esc_url($item['social_media_link']); ?>" title="<?php echo esc_attr($item['social_media_name']); ?>">
|
|
||||||
<img loading="lazy" width="32" height="32" src="<?php echo wp_get_attachment_url($icon); ?>" alt="<?php echo esc_attr($item['social_media_name']); ?>">
|
|
||||||
</a>
|
|
||||||
<?php }
|
|
||||||
}
|
|
||||||
} ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="contact-map">
|
|
||||||
<div id="ya-map" style="width: 100%; height: 625px;"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<div class="modal-programs" role="dialog" aria-modal="true" aria-label="Программа лагеря">
|
|
||||||
<div class="modal-programs__card">
|
|
||||||
<button class="modal-programs__close btn-close-programs" aria-label="Закрыть">
|
|
||||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M18 6L6 18M6 6l12 12" stroke="#fff" stroke-width="2" stroke-linecap="round"\/><\/svg>
|
|
||||||
</button>
|
|
||||||
<div class="modal-programs__img">
|
|
||||||
<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3C/svg%3E" alt="">
|
|
||||||
</div>
|
|
||||||
<div class="modal-programs__body">
|
|
||||||
<h3 class="programs__item_title"></h3>
|
|
||||||
<p class="programs__item_price"></p>
|
|
||||||
<div class="programs__content"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-mentors" role="dialog" aria-modal="true" aria-label="Информация о наставнике">
|
|
||||||
<div class="modal-mentors-wrapper">
|
|
||||||
<button class="btn-close-mentors" aria-label="Закрыть">
|
|
||||||
<svg role="presentation" class="t-popup__close-icon" width="23px" height="23px" viewBox="0 0 23 23">
|
|
||||||
<g stroke="none" stroke-width="1" fill="#3bb273" fill-rule="evenodd">
|
|
||||||
<rect
|
|
||||||
transform="translate(11.313708, 11.313708) rotate(-45.000000) translate(-11.313708, -11.313708) "
|
|
||||||
x="10.3137085" y="-3.6862915" width="2" height="30"></rect>
|
|
||||||
<rect
|
|
||||||
transform="translate(11.313708, 11.313708) rotate(-315.000000) translate(-11.313708, -11.313708) "
|
|
||||||
x="10.3137085" y="-3.6862915" width="2" height="30"></rect>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
<div class="modal-programs__img">
|
|
||||||
<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3C/svg%3E" alt="">
|
|
||||||
</div>
|
|
||||||
<div class="modal-mentors__content">
|
|
||||||
<div class="modal-mentors_name"></div>
|
|
||||||
<div class="modal-mentors_job"></div>
|
|
||||||
<div class="modal-mentors__directions"></div>
|
|
||||||
<div class="modal-mentors__about">
|
|
||||||
<div class="about-item">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/icons/icon-education.svg" alt="" width="60" height="58" loading="lazy">
|
|
||||||
<div class="mentors__about-col">
|
|
||||||
<p class="mentors__about-col_title">Образование:</p>
|
|
||||||
<div class="mentors__about-col_text"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="about-item">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/icons/icon-experience.svg" alt="" width="59" height="58" loading="lazy">
|
|
||||||
<div class="mentors__about-col">
|
|
||||||
<p class="mentors__about-col_title">Опыт работы в сфере образования:</p>
|
|
||||||
<div class="mentors__experience-col_text"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-additional__education">
|
|
||||||
<img src="<?php echo get_template_directory_uri(); ?>/assets/images/icons/icon-certificate.svg" alt="" width="58" height="60" loading="lazy">
|
|
||||||
<div class="mentors__about-col">
|
|
||||||
<p class="mentors__about-col_title">Дополнительное образование:</p>
|
|
||||||
<div class="modal-additional__education_list">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-camp-request-form" style="display: none;">
|
|
||||||
<div class="form-wrapper">
|
|
||||||
<button class="btn-close-request-form">
|
|
||||||
<img class="btn-close-request-form-camp" src="<?php echo get_template_directory_uri(); ?>/assets/images/btn-close-modal.svg" alt="кнопка закрыть окно">
|
|
||||||
</button>
|
|
||||||
<?php echo carbon_get_post_meta($post_id, 'camp_bitrix_script' ); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
(function() {
|
|
||||||
var mapLoaded = false;
|
|
||||||
var mapContainer = document.getElementById("ya-map");
|
|
||||||
if (!mapContainer) return;
|
|
||||||
|
|
||||||
var observer = new IntersectionObserver(function(entries) {
|
|
||||||
if (entries[0].isIntersecting && !mapLoaded) {
|
|
||||||
mapLoaded = true;
|
|
||||||
observer.disconnect();
|
|
||||||
|
|
||||||
var script = document.createElement("script");
|
|
||||||
script.src = "https://api-maps.yandex.ru/2.1/?lang=ru_RU";
|
|
||||||
script.onload = function() {
|
|
||||||
script.onerror = function() { console.warn("Yandex Maps API failed to load"); };
|
|
||||||
ymaps.ready(function() {
|
|
||||||
var coords = <?php echo $contact_location ? '[' . esc_js($contact_location) . ']' : '[55.76, 37.64]'; ?>;
|
|
||||||
var map = new ymaps.Map("ya-map", {
|
|
||||||
center: coords,
|
|
||||||
zoom: 16
|
|
||||||
}, {
|
|
||||||
searchControlProvider: "yandex#search"
|
|
||||||
});
|
|
||||||
|
|
||||||
var placemark = new ymaps.Placemark(
|
|
||||||
coords,
|
|
||||||
{ iconContent: "<?php echo esc_js($contact_location_text); ?>" },
|
|
||||||
{ preset: "islands#redStretchyIcon" }
|
|
||||||
);
|
|
||||||
map.geoObjects.add(placemark);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
document.body.appendChild(script);
|
|
||||||
}
|
|
||||||
}, { rootMargin: "200px" });
|
|
||||||
|
|
||||||
observer.observe(mapContainer);
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
|
||||||
get_footer();
|
|
||||||
Loading…
Reference in New Issue
Block a user