46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?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>
|