2026-10-08 15:34:25 +00:00

47 lines
2.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// Перелинковка лендинга «Семейные классы» с кластером
if (! defined('ABSPATH')) {
exit;
}
$title = dekart_family_get('family_links_title');
$links = function_exists('dekart_cf_theme_complex')
? dekart_cf_theme_complex('family_links')
: (array) dekart_family_get('family_links');
// Дефолт: перелинковка со школой и кластером (если CF пуст)
if (! $links) {
$school_id = function_exists('dekart_page_id_by_template') ? dekart_page_id_by_template('page-elementary-school.php') : 0;
$school_url = $school_id ? get_permalink($school_id) : '/nachalnaya-shkola/';
$links = array(
array( 'title' => 'Начальная школа 1–4 классы', 'url' => $school_url, 'text' => 'Программа ФГОС, малая группа, английский с 1 класса.' ),
array( 'title' => 'Подготовка к школе 5–7 лет', 'url' => '/podgotovka-k-shkole/', 'text' => 'Что стоит подтянуть перед первым классом.' ),
array( 'title' => 'Как поступить и стоимость', 'url' => $school_url . '#enrollment', 'text' => 'Шаги зачисления и школьный тариф.' ),
);
}
?>
<section class="section-bg reveal family-block family-links" data-bg="family-links">
<div class="container">
<?php if ($title) : ?><h2 class="bento-h2"><?php echo esc_html($title); ?></h2><?php endif; ?>
<div class="family-links__list">
<?php foreach ($links as $l) :
$t = $l['title'] ?? '';
$u = $l['url'] ?? '';
if (! $t || ! $u) {
continue;
}
?>
<a class="family-links__item" href="<?php echo esc_url($u); ?>">
<span class="family-links__title"><?php echo esc_html($t); ?></span>
<?php if (! empty($l['text'])) : ?>
<span class="family-links__text"><?php echo esc_html($l['text']); ?></span>
<?php endif; ?>
<span class="family-links__arrow" aria-hidden="true"><?php echo dekart_icon('arrow-right', 18); ?></span>
</a>
<?php endforeach; ?>
</div>
</div>
</section>