2026-10-08 14:29:15 +00:00

51 lines
1.5 KiB
PHP

<?php
// Гео / локация
if (! defined('ABSPATH')) {
exit;
}
$f_title = dekart_family_get('family_geo_title');
$f_text = dekart_family_get('family_geo_text');
$f_cities = (array) dekart_family_get('family_geo_cities');
$f_addr = get_option('branch_address') ?: carbon_get_theme_option('site_address');
$f_city = get_option('branch_city') ?: carbon_get_theme_option('site_city');
if (! $f_title && ! $f_text && ! $f_cities && ! $f_addr) {
return;
}
?>
<section class="section-bg reveal family-block" data-bg="family-geo">
<div class="container">
<?php if ($f_title) : ?>
<h2 class="bento-h2"><?php echo esc_html($f_title); ?></h2>
<?php endif; ?>
<?php if ($f_text) : ?>
<p class="bento-p"><?php echo esc_html($f_text); ?></p>
<?php endif; ?>
<?php if ($f_addr || $f_city) : ?>
<p class="family-geo__addr">
<?php echo esc_html(trim($f_addr . ($f_addr && $f_city ? ', ' : '') . $f_city)); ?>
</p>
<?php endif; ?>
<?php
$f_city_names = array();
foreach ($f_cities as $f_c) {
if (! empty($f_c['city'])) {
$f_city_names[] = $f_c['city'];
}
}
?>
<?php if ($f_city_names) : ?>
<ul class="family-geo__cities">
<?php foreach ($f_city_names as $f_cn) : ?>
<li><?php echo esc_html($f_cn); ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</section>