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

65 lines
2.7 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;
}
$stories = carbon_get_post_meta((int) get_the_ID(), 'front_stories');
if (empty($stories) || ! is_array($stories)) {
return;
}
?>
<section class="stories section-bg reveal" data-bg="stories">
<div class="container">
<div class="section-header--centered">
<span class="bento-label">Реальные результаты</span>
<h2 class="bento-h2">Истории успеха наших учеников</h2>
<p class="bento-p">Каждый ребёнок уникален — мы помогаем раскрыть его сильные стороны</p>
</div>
<div class="stories__scroll-hint" aria-hidden="true"><?php echo dekart_icon('arrow-down', 16); ?> Листайте истории</div>
<div class="stories__wrap">
<div class="stories__grid">
<?php foreach ($stories as $s) :
$name = $s['student_name'] ?? '';
$age = $s['age'] ?? '';
$prob = $s['problem'] ?? '';
$result = $s['result'] ?? '';
$photo = $s['photo'] ?? '';
if (! $name) {
continue;
}
?>
<div class="stories__card">
<?php if ($photo) : ?>
<div class="stories__photo">
<?php echo wp_get_attachment_image((int) $photo, 'medium_large', false, array( 'loading' => 'lazy', 'alt' => esc_attr($name) )); ?>
</div>
<?php endif; ?>
<div class="stories__body">
<h3 class="stories__name"><?php echo esc_html($name); ?><?php if ($age) :
?>, <span class="stories__age"><?php echo esc_html($age); ?></span><?php
endif; ?></h3>
<?php if ($prob) : ?>
<div class="stories__block">
<span class="stories__label stories__label--prob">Запрос</span>
<p class="stories__text"><?php echo esc_html($prob); ?></p>
</div>
<?php endif; ?>
<?php if ($result) : ?>
<div class="stories__block">
<span class="stories__label stories__label--result">Результат</span>
<p class="stories__text"><?php echo esc_html($result); ?></p>
</div>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</section>