74 lines
3.7 KiB
PHP
74 lines
3.7 KiB
PHP
<?php
|
||
|
||
/**
|
||
* Expert Quotes — блок цитаты руководителя (GEO / E-E-A-T)
|
||
*
|
||
* Данные из Carbon Fields (Главная → Слово руководителю).
|
||
* Fallback на Настройки филиала (branch_director_*).
|
||
*
|
||
* @package Dekart
|
||
*/
|
||
|
||
if (! defined('ABSPATH')) {
|
||
exit;
|
||
}
|
||
|
||
$post_id = get_the_ID();
|
||
|
||
// CF с fallback на Settings API
|
||
$quote_text = carbon_get_post_meta($post_id, 'expert_quote_text') ?: '';
|
||
$author_name = carbon_get_post_meta($post_id, 'expert_quote_author') ?: get_option('branch_director_name', '');
|
||
$author_role = carbon_get_post_meta($post_id, 'expert_quote_role') ?: get_option('branch_director_creds', '');
|
||
$author_photo = carbon_get_post_meta($post_id, 'expert_quote_photo') ?: get_option('branch_director_photo', '');
|
||
$section_title = carbon_get_post_meta($post_id, 'expert_quote_title') ?: 'Почему родители выбирают «Декарт»';
|
||
$section_subtitle = carbon_get_post_meta($post_id, 'expert_quote_subtitle') ?: 'Руководитель школы делится ценностями и подходом к обучению';
|
||
|
||
if (empty($quote_text) || empty($author_name)) {
|
||
return;
|
||
}
|
||
|
||
$photo_url = '';
|
||
if ($author_photo) {
|
||
if (is_array($author_photo) && isset($author_photo['url'])) {
|
||
$photo_url = $author_photo['url'];
|
||
} else {
|
||
$photo_url = wp_get_attachment_url((int) $author_photo);
|
||
}
|
||
}
|
||
?>
|
||
<section class="expert-quotes section-bg reveal" data-bg="expert-quotes">
|
||
<div class="container">
|
||
<div class="section-header--centered">
|
||
<span class="bento-label">Слово руководителю</span>
|
||
<h2 class="bento-h2"><?php echo esc_html($section_title); ?></h2>
|
||
<p class="bento-p"><?php echo esc_html($section_subtitle); ?></p>
|
||
</div>
|
||
|
||
<div class="expert-quotes__card">
|
||
<div class="expert-quotes__mark" aria-hidden="true">
|
||
<svg width="40" height="40" viewBox="0 0 24 24" fill="currentColor">
|
||
<path d="M11.192 15.757c0-.88-.23-1.618-.69-2.217-.326-.412-.768-.683-1.327-.812-.55-.128-1.07-.137-1.54-.028-.16-.95.1-1.956.76-3.018.66-1.062 1.42-1.828 2.268-2.3l-.842-1.683c-1.248.742-2.31 1.688-3.192 2.827-1.01 1.32-1.75 2.746-2.224 4.28-.474 1.532-.583 3.038-.33 4.518.365 1.45 1.104 2.56 2.217 3.33 1.113.77 2.36 1.06 3.74.87.89-.14 1.66-.55 2.31-1.23.65-.68.97-1.52.97-2.52zm9.808 0c0-.88-.23-1.618-.69-2.217-.326-.412-.768-.683-1.327-.812-.55-.128-1.07-.137-1.54-.028-.16-.95.1-1.956.76-3.018.66-1.062 1.42-1.828 2.268-2.3l-.842-1.683c-1.248.742-2.31 1.688-3.192 2.827-1.01 1.32-1.75 2.746-2.224 4.28-.474 1.532-.583 3.038-.33 4.518.365 1.45 1.104 2.56 2.217 3.33 1.113.77 2.36 1.06 3.74.87.89-.14 1.66-.55 2.31-1.23.65-.68.97-1.52.97-2.52z"/>
|
||
</svg>
|
||
</div>
|
||
|
||
<blockquote class="expert-quotes__text">
|
||
<p><?php echo esc_html($quote_text); ?></p>
|
||
</blockquote>
|
||
|
||
<div class="expert-quotes__author">
|
||
<?php if ($photo_url) : ?>
|
||
<img class="expert-quotes__avatar" src="<?php echo esc_url($photo_url); ?>"
|
||
alt="<?php echo esc_attr($author_name); ?>"
|
||
loading="lazy" width="56" height="56">
|
||
<?php endif; ?>
|
||
<div class="expert-quotes__info">
|
||
<cite class="expert-quotes__name"><?php echo esc_html($author_name); ?></cite>
|
||
<?php if ($author_role) : ?>
|
||
<span class="expert-quotes__role"><?php echo esc_html($author_role); ?></span>
|
||
<?php endif; ?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|