GLOBAL
This commit is contained in:
parent
92d18a09af
commit
f74fdf6eab
@ -3076,17 +3076,7 @@ Field::make('select', 'teacher_subjects_title', 'Программа (напра
|
||||
array('type' => 'post', 'post_type' => 'teacher'),
|
||||
))
|
||||
->set_max(12)
|
||||
->set_help_text('Карточки берутся из CPT. Пусто — используется список ниже.'),
|
||||
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),
|
||||
))
|
||||
->set_help_text('Выберите карточки из готового раздела «Преподаватели». Пусто — выводятся все опубликованные преподаватели.'),
|
||||
))
|
||||
->add_tab('Распорядок дня', array(
|
||||
Field::make('textarea', 'as_routine', 'Блок "Распорядок дня":'),
|
||||
@ -4744,12 +4734,12 @@ function dekart_internal_links(): array
|
||||
|
||||
$defaults = array(
|
||||
array( 'label' => 'Начальная школа', 'text' => 'Малокомплектные классы до 12 человек, английский с 1 класса', 'url' => dekart_school_successor_url() ),
|
||||
array( 'label' => 'Подготовка к школе 5–7 лет', 'text' => 'Чтение, счёт и письмо в игровой форме', 'template' => 'page-podgotovka-k-shkole.php' ),
|
||||
array( 'label' => 'Продлёнка до 19:00', 'text' => 'Уроки, прогулки и помощь с домашним заданием', 'template' => 'page-after-school.php' ),
|
||||
array( 'label' => 'Городской лагерь', 'text' => 'Тематические смены на летние каникулы', 'template' => 'page-camp.php' ),
|
||||
array( 'label' => 'Преподаватели', 'text' => 'Опытные педагоги с профильным образованием', 'template' => 'page-teachers.php' ),
|
||||
array( 'label' => 'Отзывы', 'text' => 'Оценки и истории семей наших учеников', 'template' => 'page-reviews.php' ),
|
||||
array( 'label' => 'Контакты и адрес', 'text' => 'Как добраться и записаться на экскурсию', 'template' => 'page-contacts.php' ),
|
||||
array( 'label' => 'Подготовка к школе 5–7 лет', 'text' => 'Чтение, счёт и письмо в игровой форме', 'template' => 'page-podgotovka-k-shkole.php', 'slugs' => array( 'podgotovka-k-shkole' ) ),
|
||||
array( 'label' => 'Продлёнка до 19:00', 'text' => 'Уроки, прогулки и помощь с домашним заданием', 'template' => 'page-after-school.php', 'slugs' => array( 'prodlenka' ) ),
|
||||
array( 'label' => 'Городской лагерь', 'text' => 'Тематические смены на летние каникулы', 'template' => 'page-camp.php', 'slugs' => array( 'gorodskoj-lager', 'gorodskoy-lager' ) ),
|
||||
array( 'label' => 'Преподаватели', 'text' => 'Опытные педагоги с профильным образованием', 'template' => 'page-teachers.php', 'slugs' => array( 'our-teachers', 'prepodavateli' ) ),
|
||||
array( 'label' => 'Отзывы', 'text' => 'Оценки и истории семей наших учеников', 'template' => 'page-reviews.php', 'slugs' => array( 'otzyvy', 'reviews' ) ),
|
||||
array( 'label' => 'Контакты и адрес', 'text' => 'Как добраться и записаться на экскурсию', 'template' => 'page-contacts.php', 'slugs' => array( 'kontakty', 'contacts' ) ),
|
||||
);
|
||||
foreach ($defaults as $d) {
|
||||
$url = ! empty($d['url']) ? (string) $d['url'] : dekart_resolve_page_url($d);
|
||||
@ -6310,6 +6300,21 @@ function dekart_branch_add_menu()
|
||||
add_action('admin_init', 'dekart_branch_register_settings');
|
||||
|
||||
// CF complex из сырой меты: любой расклад ключей (layout-сегмент, числовой индекс подполя)
|
||||
function dekart_post_faq_rows(int $post_id): array
|
||||
{
|
||||
foreach (array( 'post_faq', 'faq_items', 'post_faq_items' ) as $field) {
|
||||
$rows = dekart_cf_rows($post_id, $field, array( 'q', 'a' ));
|
||||
$rows = array_values(array_filter($rows, static function ($row) {
|
||||
return '' !== trim((string) ( $row['q'] ?? '' )) || '' !== trim((string) ( $row['a'] ?? '' ));
|
||||
}));
|
||||
if (! empty($rows)) {
|
||||
return $rows;
|
||||
}
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
function dekart_cf_rows(int $post_id, string $field, array $order): array
|
||||
{
|
||||
if (! $post_id || '' === $field) {
|
||||
|
||||
@ -1621,7 +1621,7 @@ function dekart_blog_jsonld(): void
|
||||
}
|
||||
$blocks[] = $posting;
|
||||
|
||||
$faq_rows = function_exists('dekart_cf_rows') ? dekart_cf_rows($post_id, 'post_faq', array( 'q', 'a' )) : array();
|
||||
$faq_rows = function_exists('dekart_post_faq_rows') ? dekart_post_faq_rows($post_id) : array();
|
||||
$questions = array();
|
||||
foreach ($faq_rows as $row) {
|
||||
$q = trim((string) ( $row['q'] ?? '' ));
|
||||
@ -1697,9 +1697,10 @@ function dekart_landing_jsonld(): void
|
||||
if ('' === $current_template && $current_id) {
|
||||
$current_template = (string) get_post_meta($current_id, '_wp_page_template', true);
|
||||
}
|
||||
// запасной триггер: FAQ в CF у лендинга
|
||||
// запасные триггеры: FAQ в CF или любой лендинг-шаблон
|
||||
$has_landing_faq = $current_id && ! empty(carbon_get_post_meta($current_id, 'as_questions'));
|
||||
if (! in_array($current_template, $schema_templates, true) && ! $has_landing_faq) {
|
||||
$is_landing = function_exists('dekart_is_landing_template') && dekart_is_landing_template();
|
||||
if (! in_array($current_template, $schema_templates, true) && ! $has_landing_faq && ! $is_landing) {
|
||||
return;
|
||||
}
|
||||
if (! function_exists('carbon_get_post_meta')) {
|
||||
|
||||
@ -16,7 +16,7 @@ $content = function_exists('dekart_blog_content')
|
||||
? dekart_blog_content($post_id)
|
||||
: array( 'html' => apply_filters('the_content', get_post_field('post_content', $post_id)), 'toc' => array() );
|
||||
|
||||
$faq = function_exists('dekart_cf_rows') ? dekart_cf_rows($post_id, 'post_faq', array( 'q', 'a' )) : array();
|
||||
$faq = function_exists('dekart_post_faq_rows') ? dekart_post_faq_rows($post_id) : array();
|
||||
$sources = function_exists('dekart_cf_rows') ? dekart_cf_rows($post_id, 'post_sources', array( 'title', 'url' )) : array();
|
||||
?>
|
||||
<main class="page-single-post page-blog">
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
// Педагоги: teachers-cards (как в ПКШ) или карточки из CF
|
||||
// Педагоги: карточки из раздела «Преподаватели» (CF association)
|
||||
|
||||
if (! defined('ABSPATH')) {
|
||||
exit;
|
||||
@ -10,7 +10,6 @@ $post_id = (int) get_the_ID();
|
||||
$title = (string) carbon_get_post_meta($post_id, 'as_teachers_title');
|
||||
$text = (string) carbon_get_post_meta($post_id, 'as_teachers_text');
|
||||
$ids_raw = carbon_get_post_meta($post_id, 'as_teacher_ids');
|
||||
$mentors = carbon_get_post_meta($post_id, 'as_mentors');
|
||||
|
||||
if ('' === trim($title)) {
|
||||
$title = 'Наши преподаватели — практикующие педагоги';
|
||||
@ -24,50 +23,9 @@ foreach ((array) $ids_raw as $row) {
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($ids)) {
|
||||
get_template_part('template-parts/teachers-cards', null, array(
|
||||
'teacher_ids' => $ids,
|
||||
'description' => $text,
|
||||
'title' => $title,
|
||||
));
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($mentors) || ! is_array($mentors)) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<section class="bento teachers-cards" id="teachers" aria-label="Преподаватели">
|
||||
<div class="bento__full section-header--centered">
|
||||
<span class="bento-label">Преподаватели</span>
|
||||
<h2 class="bento-h2"><?php echo esc_html($title); ?></h2>
|
||||
<p class="pksh-lead"><?php echo esc_html($text); ?></p>
|
||||
</div>
|
||||
<div class="bento__full">
|
||||
<div class="teachers-cards__grid">
|
||||
<?php foreach ($mentors as $mentor) :
|
||||
$name = (string) ( $mentor['mentor_name'] ?? '' );
|
||||
$desc = (string) ( $mentor['mentor_directions'] ?? '' );
|
||||
$foto = (int) ( $mentor['mentor_foto'] ?? 0 );
|
||||
if ('' === trim($name)) {
|
||||
continue;
|
||||
}
|
||||
$src = $foto ? wp_get_attachment_image_url($foto, 'medium_large') : '';
|
||||
?>
|
||||
<article class="teachers-cards__card">
|
||||
<?php if ($src) : ?>
|
||||
<div class="teachers-cards__card-top">
|
||||
<img class="teachers-cards__photo" src="<?php echo esc_url($src); ?>" alt="<?php echo esc_attr($name); ?>" loading="lazy" width="140" height="140">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="teachers-cards__card-body">
|
||||
<h3 class="teachers-cards__name"><?php echo esc_html($name); ?></h3>
|
||||
<?php if ('' !== trim($desc)) : ?>
|
||||
<p class="teachers-cards__subj"><?php echo esc_html($desc); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
// пусто — берём всех опубликованных преподавателей
|
||||
get_template_part('template-parts/teachers-cards', null, array(
|
||||
'teacher_ids' => $ids,
|
||||
'description' => $text,
|
||||
'title' => $title,
|
||||
));
|
||||
|
||||
@ -187,7 +187,7 @@ if (empty($opt_social) || ! is_array($opt_social)) {
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="contacts__map<?php echo '' === $map_poster ? ' contacts__map--empty' : ''; ?>">
|
||||
<div class="contacts__map">
|
||||
<?php if (! empty($opt_coords)) : ?>
|
||||
<div id="ya-map"<?php echo '' !== $map_poster ? ' style="background-image:url(' . esc_url($map_poster) . ');background-size:cover;background-position:center;"' : ''; ?>
|
||||
data-coords="<?php echo esc_attr($opt_coords); ?>"
|
||||
|
||||
@ -11,8 +11,23 @@ $title = trim((string) carbon_get_post_meta($post_id, 'pksh_ages_act_title'));
|
||||
$text = trim((string) carbon_get_post_meta($post_id, 'pksh_ages_act_text'));
|
||||
$items = carbon_get_post_meta($post_id, 'pksh_ages_act_items');
|
||||
|
||||
if ('' === $title || ! is_array($items) || empty($items)) {
|
||||
return;
|
||||
$size = function_exists('dekart_pksh_group_size') ? dekart_pksh_group_size() : '2–6';
|
||||
|
||||
if ('' === $title) {
|
||||
$title = 'Занятия для детей 5–7 лет';
|
||||
}
|
||||
if ('' === $text) {
|
||||
$text = sprintf('Программа строится на пяти навыках: чтение, счёт, письмо, речь и логика. Отдельно тренируем внимание — без него ребёнок не удерживает инструкцию из двух-трёх шагов. Занятия идут в группе %s человек.', $size);
|
||||
}
|
||||
if (! is_array($items) || empty($items)) {
|
||||
$items = array(
|
||||
array( 'act_title' => 'Чтение', 'act_example' => 'Читаем по слогам с карточками: ребёнок собирает слово из слогов, читает его вслух и находит предмет на картинке.' ),
|
||||
array( 'act_title' => 'Счёт', 'act_example' => 'Считаем предметы и сравниваем количества: «на сколько яблок больше, чем груш» — с числовой прямой до 10.' ),
|
||||
array( 'act_title' => 'Письмо', 'act_example' => 'Печатаем буквы в прописях с ориентирами: сначала обводим, потом пишем самостоятельно, следим за строкой.' ),
|
||||
array( 'act_title' => 'Речь', 'act_example' => 'Составляем рассказ по серии картинок из четырёх кадров: кто, где, что делает и чем всё закончилось.' ),
|
||||
array( 'act_title' => 'Логика', 'act_example' => 'Ищем лишний предмет и продолжаем последовательность: фигуры, цвета, простые закономерности на карточках.' ),
|
||||
array( 'act_title' => 'Внимание', 'act_example' => 'Игра «найди отличия» и слуховые команды из трёх шагов: ребёнок выполняет инструкцию без повторов.' ),
|
||||
);
|
||||
}
|
||||
|
||||
if (function_exists('dekart_fill_placeholders')) {
|
||||
|
||||
@ -11,8 +11,21 @@ $title = trim((string) carbon_get_post_meta($post_id, 'pksh_why_group_title'))
|
||||
$text = trim((string) carbon_get_post_meta($post_id, 'pksh_why_group_text'));
|
||||
$items = carbon_get_post_meta($post_id, 'pksh_why_group_items');
|
||||
|
||||
if ('' === $title || ! is_array($items) || empty($items)) {
|
||||
return;
|
||||
$size = function_exists('dekart_pksh_group_size') ? dekart_pksh_group_size() : '2–6';
|
||||
|
||||
if ('' === $title) {
|
||||
$title = sprintf('Мини-группа %s человек: почему так', $size);
|
||||
}
|
||||
if ('' === $text) {
|
||||
$text = sprintf('В группе %s детей педагог успевает проверить работу каждого и дать слово на каждом задании. Ниже — как устроен формат и чем он отличается от группы из десяти человек.', $size);
|
||||
}
|
||||
if (! is_array($items) || empty($items)) {
|
||||
$items = array(
|
||||
array( 'why_title' => 'Почему такой предел', 'why_text' => 'Педагог ведёт от двух до шести детей: за занятие он слышит чтение каждого, поправляет посадку и объясняет задание лично. На проверку тетрадей уходит 10–15 минут.' ),
|
||||
array( 'why_title' => 'Сколько внимания получает ребёнок', 'why_text' => 'В группе из шести детей на одного ученика приходится около 7–8 минут личного контакта за урок: чтение вслух, разбор ошибки, подсказка по письму.' ),
|
||||
array( 'why_title' => 'Что меняется по сравнению с группой 10 человек', 'why_text' => 'Меньше ожидания и больше попыток: ребёнок читает слог несколько раз, решает пример и сразу слышит, где ошибся.' ),
|
||||
array( 'why_title' => 'Как проходит занятие', 'why_text' => '30–40 минут: разминка на внимание, чтение по слогам, письмо в прописях, счёт на карточках и короткая игра. Каждый этап заканчивается проверкой.' ),
|
||||
);
|
||||
}
|
||||
|
||||
if (function_exists('dekart_fill_placeholders')) {
|
||||
|
||||
@ -13,7 +13,9 @@ if (! $tid) {
|
||||
|
||||
|
||||
$cta_label = isset($args['cta_label']) && $args['cta_label'] !== '' ? (string) $args['cta_label'] : 'Записаться к преподавателю';
|
||||
$cta_goal = isset($args['cta_goal']) && $args['cta_goal'] !== '' ? (string) $args['cta_goal'] : 'teacher_card_form';
|
||||
$cta_goal = isset($args['cta_goal']) && $args['cta_goal'] !== ''
|
||||
? (string) $args['cta_goal']
|
||||
: ( function_exists('dekart_is_landing_template') && dekart_is_landing_template() ? dekart_landing_goal('cta_form') : 'teacher_card_form' );
|
||||
|
||||
$teacher_review_counts = function_exists('dekart_teacher_review_counts') ? dekart_teacher_review_counts() : array();
|
||||
$current_year = (int) current_time('Y');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user