2026-09-09 14:09:32 +00:00

55 lines
2.0 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
/**
* Преподаватели — вводный блок (SEO + позиционирование)
* H1 берётся из баннера (banner_h1), здесь — H2 с гео-ключом + текст.
*
* @package Dekart
*/
if (! defined('ABSPATH')) {
exit;
}
$post_id = (int) get_the_ID();
$intro_title = carbon_get_post_meta($post_id, 'teachers_intro_title');
if (empty($intro_title)) {
$intro_title = 'Преподаватели школы «Декарт» в Щёлково';
}
$intro_text = carbon_get_post_meta($post_id, 'teachers_intro_text');
if (empty($intro_text)) {
return;
}
// ─── Контекстные внутренние ссылки (SEO-перелинковка) ───
$teachers_ctx_targets = array(
'nachalnaya-shkola' => 'Начальная школа',
'podgotovka-k-shkole' => 'Подготовка к школе',
'prodlenka' => 'Продлёнка',
'gorodskoj-lager' => 'Летний лагерь',
);
$teachers_ctx_links = array();
foreach ($teachers_ctx_targets as $slug => $label) {
$pg = get_page_by_path($slug);
if ($pg) {
$teachers_ctx_links[] = array( 'url' => get_permalink($pg), 'label' => $label );
}
}
?>
<section class="teachers-intro section-bg reveal" data-bg="teachers-intro" aria-labelledby="teachers-intro-title">
<div class="container">
<div class="section-header--left">
<h2 id="teachers-intro-title" class="bento-h2"><?php echo esc_html($intro_title); ?></h2>
<p class="bento-p"><?php echo esc_html($intro_text); ?></p>
<?php if (! empty($teachers_ctx_links)) : ?>
<div class="teachers-intro__links">
<?php foreach ($teachers_ctx_links as $ctx_link) : ?>
<a class="teachers-intro__link" href="<?php echo esc_url($ctx_link['url']); ?>"><?php echo esc_html($ctx_link['label']); ?> →</a>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</div>
</section>