59 lines
3.1 KiB
PHP
59 lines
3.1 KiB
PHP
<?php
|
||
|
||
// Мини-группы и возрасты
|
||
|
||
if (! defined('ABSPATH')) {
|
||
exit;
|
||
}
|
||
|
||
$post_id = get_the_ID();
|
||
|
||
$mini_title = carbon_get_post_meta($post_id, 'pksh_minigroup_title') ?: 'Мини-группы до 10 человек';
|
||
$mini_text = carbon_get_post_meta($post_id, 'pksh_minigroup_text') ?: 'Небольшие группы — педагог успевает уделить внимание каждому ребёнку и видит прогресс на каждом занятии.';
|
||
$mini_compare = carbon_get_post_meta($post_id, 'pksh_minigroup_compare') ?: '';
|
||
|
||
$ages = carbon_get_post_meta($post_id, 'pksh_ages');
|
||
if (empty($ages) || ! is_array($ages)) {
|
||
$ages = array(
|
||
array( 'age_label' => '5 лет', 'age_title' => 'Первые шаги', 'age_text' => 'Знакомство с буквами, счётом и письмом в игровой форме.' ),
|
||
array( 'age_label' => '6 лет', 'age_title' => 'Готовимся к школе', 'age_text' => 'Чтение по слогам, счёт, развитие речи и внимания.' ),
|
||
array( 'age_label' => '7 лет', 'age_title' => 'Уверенный первоклассник', 'age_text' => 'Чтение, письмо, математика и навыки самостоятельной работы.' ),
|
||
);
|
||
}
|
||
|
||
if (function_exists('dekart_fill_placeholders')) {
|
||
$mini_text = dekart_fill_placeholders((string) $mini_text);
|
||
$mini_compare = dekart_fill_placeholders((string) $mini_compare);
|
||
}
|
||
?>
|
||
<section class="bento pksh-section" id="minigroups" aria-label="Мини-группы и возрасты">
|
||
<div class="bento__full section-header--left">
|
||
<h2 class="bento-h2"><?php echo esc_html($mini_title); ?></h2>
|
||
<div class="pksh-info-card">
|
||
<span class="pksh-info-card__icon"><?php echo dekart_icon('users', 24); ?></span>
|
||
<p class="pksh-info-card__text"><?php echo esc_html($mini_text); ?></p>
|
||
</div>
|
||
<?php if ('' !== $mini_compare) : ?><p class="pksh-lead"><?php echo esc_html($mini_compare); ?></p><?php endif; ?>
|
||
</div>
|
||
<?php if (! empty($ages) && is_array($ages)) : ?>
|
||
<div class="bento__full">
|
||
<div class="pksh-ages">
|
||
<?php foreach ($ages as $age) :
|
||
$label = isset($age['age_label']) ? trim((string) $age['age_label']) : '';
|
||
$title = isset($age['age_title']) ? trim((string) $age['age_title']) : '';
|
||
$text = isset($age['age_text']) ? trim((string) $age['age_text']) : '';
|
||
if ('' === $label && '' === $title) {
|
||
continue;
|
||
}
|
||
?>
|
||
<div class="pksh-ages__item">
|
||
<?php if ('' !== $label) : ?><span class="pksh-ages__label"><?php echo esc_html($label); ?></span><?php endif; ?>
|
||
<?php if ('' !== $title) : ?><h3 class="pksh-ages__title"><?php echo esc_html($title); ?></h3><?php endif; ?>
|
||
<?php if ('' !== $text) : ?><p class="pksh-ages__text"><?php echo esc_html($text); ?></p><?php endif; ?>
|
||
</div>
|
||
<?php endforeach; ?>
|
||
</div>
|
||
</div>
|
||
<?php endif; ?>
|
||
</section>
|