shkola/wp-content/themes/dekart/template-parts/pksh/contacts.php
2026-07-12 13:06:48 +00:00

84 lines
3.3 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
/**
* Контакты + Яндекс.Карта
* .bento .pksh-section #pksh-contact
*
* @package Dekart
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$data = Pksh_Data::instance();
$opt_phone = $data->get_phone();
$opt_email = $data->get_email();
$opt_address = $data->get_address();
$opt_social = $data->get_social_links();
$opt_coords = $data->get_coords();
$opt_name = $data->get_name();
?>
<section class="bento pksh-section" id="pksh-contact" aria-label="Контакты">
<div class="bento__full section-header--centered">
<span class="bento-label">Контакты</span>
<h2 class="bento-h2">Наш адрес</h2>
<p class="bento-p">Ждём вас в гости — удобно добираться из любого района города</p>
</div>
<div class="bento__full pksh-contact">
<div class="pksh-contact__wrapper">
<div class="pksh-contact__info">
<?php if ( ! empty( $opt_phone ) ) : ?>
<div class="pksh-contact__subtitle">Телефон:</div>
<a class="pksh-contact__value" href="tel:+<?php echo preg_replace( '/[^0-9]/', '', $opt_phone ); ?>"><?php echo esc_html( $opt_phone ); ?></a>
<?php endif; ?>
<?php if ( ! empty( $opt_email ) ) : ?>
<div class="pksh-contact__subtitle">Почта:</div>
<a class="pksh-contact__value" href="mailto:<?php echo esc_attr( $opt_email ); ?>"><?php echo esc_html( $opt_email ); ?></a>
<?php endif; ?>
<?php if ( ! empty( $opt_address ) ) : ?>
<div class="pksh-contact__subtitle">Адрес:</div>
<div class="pksh-contact__value"><?php echo esc_html( $opt_address ); ?></div>
<?php endif; ?>
<div class="pksh-contact__logistics">
<span class="pksh-contact__logistics-item">
<span class="pksh-contact__logistics-icon">📍</span>
<span class="pksh-contact__logistics-text">5 минут пешком от ТЦ «Глобус»</span>
</span>
<span class="pksh-contact__logistics-item">
<span class="pksh-contact__logistics-icon">🅿️</span>
<span class="pksh-contact__logistics-text">Есть бесплатная парковка у входа</span>
</span>
<span class="pksh-contact__logistics-item">
<span class="pksh-contact__logistics-icon">🚸</span>
<span class="pksh-contact__logistics-text">Рядом со школами №9 и №12, детским садом №15</span>
</span>
</div>
<?php if ( ! empty( $opt_social ) && is_array( $opt_social ) ) : ?>
<div class="pksh-contact__subtitle">Наши соцсети:</div>
<div class="pksh-contact__social">
<?php foreach ( $opt_social as $item ) :
$link = $item['url'] ?? '';
$name = $item['name'] ?? '';
if ( $link ) : ?>
<a class="pksh-contact__social-link" href="<?php echo esc_url( $link ); ?>" target="_blank" rel="noopener noreferrer" title="<?php echo esc_attr( $name ); ?>">
<?php echo esc_html( $name ?: $link ); ?>
</a>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<div class="pksh-contact__map">
<div id="ya-map" style="width: 100%; height: 100%; min-height: 400px;"
data-coords="<?php echo esc_attr( $opt_coords ?: '55.7558,37.6173' ); ?>"
data-label="<?php echo esc_attr( $opt_name ?: 'Детский центр «Декарт»' ); ?>"></div>
</div>
</div>
</div>
</section>