2026-07-27 17:00:30 +00:00

61 lines
2.1 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
/**
* Секция «День из жизни ученика» — главная страница
*
* @package Dekart
* @since 1.0.0
*/
if (! defined('ABSPATH')) {
exit;
}
$items = carbon_get_post_meta((int) get_the_ID(), 'front_daylife');
if (empty($items) || ! is_array($items)) {
return;
}
?>
<section class="daylife section-bg reveal" data-bg="daylife">
<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="daylife__grid">
<?php $idx = 0; ?>
<?php foreach ($items as $item) :
$t = $item['time'] ?? '';
$title = $item['title'] ?? '';
$desc = $item['desc'] ?? '';
$photo_id = $item['photo'] ?? '';
if (! $title) {
continue;
}
$is_even = $idx % 2 === 1;
$idx++;
?>
<div class="daylife__card">
<?php if ($photo_id) : ?>
<div class="daylife__photo">
<?php echo wp_get_attachment_image((int) $photo_id, 'medium', false, array( 'loading' => 'lazy', 'alt' => esc_attr($title) )); ?>
</div>
<?php endif; ?>
<div class="daylife__body">
<?php if ($t) : ?>
<span class="daylife__time"><?php echo esc_html($t); ?></span>
<?php endif; ?>
<h3 class="daylife__title"><?php echo esc_html($title); ?></h3>
<?php if ($desc) : ?>
<p class="daylife__desc"><?php echo esc_html($desc); ?></p>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</section>