Files
hantico/wp-content/themes/hantico/template-parts/courier-services.php
T
web_55 39e8d5a8e1 task-17075__opdate-blog (#1)
Сделал
1. Сделать пункты в "ТЗ Статья"
2. Сделать пункты в "ТЗ Хабовая страница"
3. Добавить микроразметку для статьи и блога

https://docs.google.com/document/d/1ouFTKIXGk44hKONDDNWFGXBVqG06LWb7Jt28yFxklME/edit?tab=t.f4g9ytbmj2o8#heading=h.91km96rm8vln

Reviewed-on: #1
Co-authored-by: WEB № 55 - Кирилл | Верстка <web_55@good-production.xyz>
2026-10-26 13:36:52 +03:00

66 lines
3.8 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
$services_title_fields = get_field('services_title');
$services_audience = is_array($services_title_fields) ? ($services_title_fields['audience'] ?? '') : '';
$services_order_type = is_array($services_title_fields) ? ($services_title_fields['order_type'] ?? '') : '';
$services_title = ($services_audience || $services_order_type)
? sprintf('Быстрая регистрация и заказы для %s из популярных агрегаторов %s', $services_audience, $services_order_type)
: '';
$services_description = get_field('services_description');
$services_title_links = get_field('services_title_links');
$services_links = get_field('services_links') ?: [];
$services_repeat = get_field('services_repeat') ?: [];
if (!$services_title && !$services_repeat) {
return;
}
?>
<section class="courier-services"<?php if ($services_title) : ?> aria-labelledby="courier-services-title"<?php endif; ?>>
<?php if ($services_title || $services_description) : ?>
<header class="courier-services__header">
<?php if ($services_title) : ?>
<h2 class="courier-services__title" id="courier-services-title"><?php echo esc_html($services_title); ?></h2>
<?php endif; ?>
<?php if ($services_description) : ?>
<p class="courier-services__description">С Hantico проще выбрать подходящий сервис <?php echo esc_html($services_description); ?>, пройти регистрацию и начать получать заказы.</p>
<?php endif; ?>
</header>
<?php endif; ?>
<?php if ($services_links || $services_repeat) : ?>
<div class="courier-services__content">
<?php if ($services_links) : ?>
<nav class="courier-services__navigation" aria-label="О работе курьером">
<?php if ($services_title_links) : ?>
<p class="courier-services__navigation-title"><?php echo esc_html($services_title_links); ?></p>
<?php endif; ?>
<div class="courier-services__topics">
<?php foreach ($services_links as $item) : ?>
<?php if (empty($item['name']) || empty($item['url'])) continue; ?>
<a class="courier-services__topic" href="<?php echo esc_url($item['url']); ?>"><?php echo esc_html($item['name']); ?></a>
<?php endforeach; ?>
</div>
</nav>
<?php endif; ?>
<?php if ($services_repeat) : ?>
<ul class="courier-services__grid" aria-label="Сервисы доставки">
<?php foreach ($services_repeat as $item) : ?>
<?php
if (empty($item['name']) || empty($item['link'])) continue;
$logo = $item['img'] ?? [];
?>
<li>
<a class="courier-services__card" target="_blank" href="<?php echo esc_url($item['link']); ?>" aria-label="<?php echo esc_attr(sprintf('Подключиться к сервису «%s» через Hantico', $item['name'])); ?>">
<?php if (!empty($logo['url'])) : ?>
<span class="courier-services__logo"><img src="<?php echo esc_url($logo['url']); ?>" alt="" loading="lazy" decoding="async"></span>
<?php endif; ?>
<span class="courier-services__name"><?php echo esc_html($item['name']); ?></span>
<span class="courier-services__arrow" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 13 13" fill="none" focusable="false"><path d="M12.5537 7.72367L10.6267 7.71891L10.6369 3.27442L1.36107 12.5326L0.00014086 11.1689L9.25079 1.93597L4.8608 1.92575L4.86557 0.000152722L12.5721 0.0178628L12.5537 7.72367Z" fill="currentColor"/></svg></span>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
<?php endif; ?>
</section>