2026-09-08 18:38:27 +00:00

46 lines
1.2 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
/**
* Преподаватели — блок доверия / цифры
* CF teachers_trust (complex: number + label). Показывается если есть данные.
*
* @package Dekart
*/
if (! defined('ABSPATH')) {
exit;
}
$post_id = (int) get_the_ID();
$trust = carbon_get_post_meta($post_id, 'teachers_trust');
if (empty($trust) || ! is_array($trust)) {
return;
}
$trust_items = array();
foreach ($trust as $t) {
$num = $t['trust_number'] ?? '';
$label = $t['trust_label'] ?? '';
if (! $num || ! $label) {
continue;
}
$trust_items[] = array( 'num' => $num, 'label' => $label );
}
if (empty($trust_items)) {
return;
}
?>
<section class="teachers-trust section-bg reveal" data-bg="teachers-trust" aria-label="Цифры о преподавателях">
<div class="container">
<div class="teachers-trust__grid">
<?php foreach ($trust_items as $ti) : ?>
<div class="teachers-trust__item">
<div class="teachers-trust__number"><?php echo esc_html($ti['num']); ?></div>
<div class="teachers-trust__label"><?php echo esc_html($ti['label']); ?></div>
</div>
<?php endforeach; ?>
</div>
</div>
</section>