Task 10121 | fix: поправили прайсы цен для карт, которые некорректно выводятся при заполнении из админки
This commit is contained in:
302
header.php
302
header.php
@@ -9,7 +9,9 @@
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
|
||||
|
||||
<?php
|
||||
echo(get_field( 'yandex_metrics', 'option' ));
|
||||
$room = get_current_room();
|
||||
$base_classes = 'bg-[#f9f9f9] dark:bg-[#f4f4f4] text-[#222]';
|
||||
|
||||
@@ -29,63 +31,78 @@ if ($room === 'gym') {
|
||||
|
||||
<header class="container mx-auto absolute left-0 right-0 z-[49] <?php echo is_admin_bar_showing() ? 'top-[32px]' : 'top-0'; ?>"
|
||||
id="site-header">
|
||||
<div class="pt-[24px] dark:text-[#f8f8f8]">
|
||||
<div class="pt-[24px] max-[768px]:pb-[22px] dark:text-[#f8f8f8]">
|
||||
|
||||
<div>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="max-[768px]:flex-wrap max-[768px]:gap-[16px] max-[1200px]:justify-start max-[1200px]:gap-[12px] flex justify-between items-center">
|
||||
<a href="<?php echo esc_url(home_url('/')); ?>">
|
||||
<?php display_icon(get_current_room() === 'gym' ? 'dark_logo' : 'light_logo'); ?>
|
||||
</a>
|
||||
<?php get_template_part('template-parts/la-components/language-switcher'); ?>
|
||||
<div class="flex items-center gap-[12px]">
|
||||
<div class="max-[768px]:flex-col max-[768px]:items-start max-[768px]:gap-0 max-[768px]:w-full max-[768px]:order-1 flex items-center gap-[6px] dark:text-[#fff]">
|
||||
<?php get_template_part('template-parts/la-components/language-switcher'); ?>
|
||||
<span class="max-[768px]:mx-auto max-[768px]:max-w-full text-[12px] font-[500] max-[768px]:text-[14px] max-w-[60px] max-[768px]:[&>br]:hidden">Переключайте <br> формат</span>
|
||||
</div>
|
||||
<div class="max-[1200px]:hidden flex items-center gap-[12px]">
|
||||
<div class="w-[8px] h-[8px] rounded-full bg-[#e21e24]"></div>
|
||||
<div class="leading-[125%] text-[14px] font-[600]">
|
||||
<p>г. Томск, </p>
|
||||
<p>ул. Красноармейская, 120</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-[12px]">
|
||||
<div class="max-[1200px]:hidden flex items-center gap-[12px]">
|
||||
<div class="w-[8px] h-[8px] rounded-full bg-[#e21e24]"></div>
|
||||
<div class="leading-[125%] text-[14px] font-[600]">
|
||||
<p>Пн–Пт: 7:00 – 23:00</p>
|
||||
<p>Сб–Вс: 9:00 – 22:00</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-[4px]">
|
||||
<a class="dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition" href="#">
|
||||
<div class="max-[1200px]:ml-auto flex gap-[4px]">
|
||||
<a class="max-[1250px]:w-[30px] max-[1250px]:h-[30px] dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition"
|
||||
href="https://t.me/FakelGym_bot">
|
||||
<?php display_icon(get_current_room() === 'gym' ? 'tg_dark' : 'tg'); ?>
|
||||
</a>
|
||||
<a class="dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition" href="#">
|
||||
<a class="max-[1250px]:w-[30px] max-[1250px]:h-[30px] dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition"
|
||||
href="https://wa.me/79832321319">
|
||||
<?php display_icon(get_current_room() === 'gym' ? 'whatsapp_dark' : 'whatsapp'); ?>
|
||||
</a>
|
||||
<a class="hidden max-[1250px]:block dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150 transition"
|
||||
href="tel:+783822990019">
|
||||
<?php display_icon(get_current_room() === 'gym' ? 'phone_dark' : 'phone'); ?>
|
||||
</a>
|
||||
<a class="[&>img]:w-[36px] max-[1250px]:hidden dark:hover:text-[#c7c7c7] font-[700] text-[24px] !decoration-transparent hover:text-[#555] transition-colors dark:hover:[&>img]:brightness-90 hover:[&>img]:brightness-150"
|
||||
href="tel:+783822990019">
|
||||
<?php display_icon(get_current_room() === 'gym' ? 'phone_dark' : 'phone'); ?>
|
||||
</a>
|
||||
</div>
|
||||
<a class="dark:hover:text-[#c7c7c7] font-[700] text-[24px] !decoration-transparent hover:text-[#555] transition-colors"
|
||||
href="tel:+783822990019">
|
||||
+7 (3822) 99-00-19
|
||||
</a>
|
||||
<div>
|
||||
<button class="red-gradient-hover cursor-pointer flex text-[#f8f8f8] text-[16px] font-[600] justify-center h-[45px] w-[136px] rounded-[90px] flex items-center">
|
||||
|
||||
<div class="max-[850px]:hidden">
|
||||
<?php
|
||||
$page = get_page_by_path('prices');
|
||||
?>
|
||||
<a href="
|
||||
<?php
|
||||
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
|
||||
?>
|
||||
"
|
||||
class="max-[768px]:h-[36px] !no-underline items-center red-gradient-hover cursor-pointer flex text-[#f8f8f8] text-[16px] font-[600] justify-center h-[45px] w-[136px] rounded-[90px] flex items-center">
|
||||
Записаться
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
<div id="burger"
|
||||
class="hidden max-[1200px]:block cursor-pointer w-[36px] h-[36px] relative focus:outline-none bg-[linear-gradient(90deg,_#e21e24_39.42%,_#ff2f35_92.9%)] rounded-[90px] z-[20]">
|
||||
<div class="flex items-center justify-center w-full h-full absolute left-[50%] top-[50%] transform -translate-x-[50%] -translate-y-[50%]">
|
||||
<span class="line-1 block absolute h-[2px] w-[20px] bg-white transform transition -translate-y-[6px]"></span>
|
||||
<span class="line-2 block absolute h-[2px] w-[20px] bg-white transform transition"></span>
|
||||
<span class="line-3 block absolute h-[2px] w-[20px] bg-white transform transition translate-y-[6px]"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/* wp_nav_menu(
|
||||
array(
|
||||
'container_id' => 'primary-menu',
|
||||
'container_class' => 'hidden bg-gray-100 mt-4 p-4 lg:mt-0 lg:p-0 lg:bg-transparent lg:block',
|
||||
'menu_class' => 'lg:flex lg:-mx-4',
|
||||
'theme_location' => 'primary',
|
||||
'li_class' => 'lg:mx-4',
|
||||
'fallback_cb' => false,
|
||||
)
|
||||
);
|
||||
*/ ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-[24px]">
|
||||
<div class="flex items-center justify-between gap-[32px]">
|
||||
<div class="py-[24px] max-[768px]:hidden">
|
||||
<div class="flex items-center justify-between gap-[6px]">
|
||||
<div class="
|
||||
group
|
||||
dark:border dark:border-white/[0.05]
|
||||
@@ -96,26 +113,124 @@ if ($room === 'gym') {
|
||||
dark:border-[rgba(248,_248,_248,_0.5)] bg-white text-[16px] text-[#222] font-[600] rounded-[90px] h-[44px] px-[28px] flex items-center">
|
||||
<?php get_template_part('template-parts/la-components/navigation-menu'); ?>
|
||||
</div>
|
||||
<div class="flex gap-[12px]">
|
||||
<button data-modal="time"
|
||||
class="dark:text-[#f8f8f8] dark:border-[rgba(248,_248,_248,_0.2)] font-[600] flex gap-[8px] h-[44px] px-[20px] items-center cursor-pointer border border-[#e0e0e0] rounded-[90px]"
|
||||
<div class="max-[1200px]:hidden flex gap-[12px]">
|
||||
<?php
|
||||
$page = get_page_by_path('time');
|
||||
?>
|
||||
<a href="<?php
|
||||
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
|
||||
?>"
|
||||
class="dark:hidden !no-underline dark:text-[#f8f8f8] dark:border-[rgba(248,_248,_248,_0.2)] font-[600] flex gap-[8px] h-[44px] px-[20px] items-center cursor-pointer border border-[#e0e0e0] rounded-[90px]"
|
||||
>
|
||||
<span class="dark:bg-[#f8f8f8] w-[8px] h-[8px] rounded-full bg-[#e21e24]"></span>
|
||||
Расписание
|
||||
</button>
|
||||
<button
|
||||
class="font-[600] text-[#f8f8f8] dark-gradient-hover flex gap-[8px] h-[44px] px-[20px] items-center cursor-pointer rounded-[90px]"
|
||||
</a>
|
||||
<?php
|
||||
$page = get_page_by_path('lk');
|
||||
?>
|
||||
<a href="
|
||||
<?php
|
||||
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
|
||||
?>"
|
||||
class="!no-underline font-[600] text-[#f8f8f8] dark-gradient-hover flex gap-[8px] h-[44px] px-[20px] items-center cursor-pointer rounded-[90px]"
|
||||
>
|
||||
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8 0.5C9.06087 0.5 10.0783 0.921427 10.8284 1.67157C11.5786 2.42172 12 3.43913 12 4.5C12 5.56087 11.5786 6.57828 10.8284 7.32843C10.0783 8.07857 9.06087 8.5 8 8.5C6.93913 8.5 5.92172 8.07857 5.17157 7.32843C4.42143 6.57828 4 5.56087 4 4.5C4 3.43913 4.42143 2.42172 5.17157 1.67157C5.92172 0.921427 6.93913 0.5 8 0.5ZM8 10.5C12.42 10.5 16 12.29 16 14.5V16.5H0V14.5C0 12.29 3.58 10.5 8 10.5Z"
|
||||
fill="#F8F8F8"/>
|
||||
</svg>
|
||||
Личный кабинет
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="menu-overlay"
|
||||
class="max-[768px]:h-[calc(100vh-141px)] max-[768px]:top-[141px] fixed h-[calc(100vh-161px)] top-[161px] left-0 right-0 bg-[rgba(0,0,0,0.5)] backdrop-blur-sm z-[9999] opacity-[0] invisible transition-[opacity,visibility] ease-in-out">
|
||||
<div id="menu-container"
|
||||
class="fixed right-[0] top-[0] h-full w-[327px] bg-[#f9f9f9] dark:bg-[#151419] transform translate-x-full transition-[transform] flex flex-col">
|
||||
|
||||
<nav class="p-[20px] pr-[10px] flex-1 overflow-y-auto">
|
||||
<ul class="flex flex-col gap-[4px]">
|
||||
<?php
|
||||
$menu_items = get_simple_menu_items();
|
||||
foreach ($menu_items as $item):
|
||||
?>
|
||||
<li class="w-full h-[35px]">
|
||||
<a class="!no-underline w-full h-full text-[#222] dark:text-[#f8f8f8] dark:hover:text-[#c7c7c7] hover:text-[#555] hover:text-[#555] font-[600] leading-[125%] text-[16px]"
|
||||
href="<?php echo esc_url($item['url']); ?>">
|
||||
<?php echo esc_html($item['title']); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<div class="max-[1200px]:flex hidden text-[14px] justify-between flex-wrap gap-[6px] mt-[16px]">
|
||||
<?php
|
||||
$page = get_page_by_path('time');
|
||||
?>
|
||||
<a href="<?php
|
||||
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
|
||||
?>"
|
||||
class="dark:hidden !no-underline max-w-[135px] px-[12px] dark:text-[#f8f8f8] dark:border-[rgba(248,_248,_248,_0.2)] font-[600] flex gap-[6px] h-[41px] items-center cursor-pointer border border-[#e0e0e0] rounded-[90px]"
|
||||
>
|
||||
<span class="dark:bg-[#f8f8f8] w-[8px] h-[8px] rounded-full bg-[#e21e24]"></span>
|
||||
Расписание
|
||||
</a>
|
||||
<?php
|
||||
$page = get_page_by_path('lk');
|
||||
?>
|
||||
<a href="
|
||||
<?php
|
||||
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
|
||||
?>"
|
||||
class="!no-underline max-w-[176px] px-[12px] font-[600] text-[#f8f8f8] dark-gradient-hover flex gap-[6px] h-[41px] items-center cursor-pointer rounded-[90px]"
|
||||
>
|
||||
<svg class="min-w-fit" width="12" height="12" viewBox="0 0 16 17" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8 0.5C9.06087 0.5 10.0783 0.921427 10.8284 1.67157C11.5786 2.42172 12 3.43913 12 4.5C12 5.56087 11.5786 6.57828 10.8284 7.32843C10.0783 8.07857 9.06087 8.5 8 8.5C6.93913 8.5 5.92172 8.07857 5.17157 7.32843C4.42143 6.57828 4 5.56087 4 4.5C4 3.43913 4.42143 2.42172 5.17157 1.67157C5.92172 0.921427 6.93913 0.5 8 0.5ZM8 10.5C12.42 10.5 16 12.29 16 14.5V16.5H0V14.5C0 12.29 3.58 10.5 8 10.5Z"
|
||||
fill="#F8F8F8"/>
|
||||
</svg>
|
||||
Личный кабинет
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="pt-[16px] mt-[16px] border-t border-[#e0e0e0] text-[#222] dark:text-[#f8f8f8]">
|
||||
<div class="text-[14px]">
|
||||
<a class="dark:hover:text-[#c7c7c7] font-[700] text-[24px] !decoration-transparent hover:text-[#555] transition-colors"
|
||||
href="tel:+783822990019">
|
||||
<span>+7 (3822) 99-00-19</span>
|
||||
</a>
|
||||
<div class="mt-[16px] flex items-center gap-[12px]">
|
||||
<div class="w-[8px] h-[8px] rounded-full bg-[#e21e24]"></div>
|
||||
<div class="leading-[125%] text-[14px] font-[600]">
|
||||
<p>г. Томск, </p>
|
||||
<p>ул. Красноармейская, 120</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-[12px] flex items-center gap-[12px]">
|
||||
<div class="w-[8px] h-[8px] rounded-full bg-[#e21e24]"></div>
|
||||
<div class="leading-[125%] text-[14px] font-[600]">
|
||||
<p>Пн–Пт: 7:00 – 23:00</p>
|
||||
<p>Сб–Вс: 9:00 – 22:00</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<?php
|
||||
$page = get_page_by_path('prices');
|
||||
?>
|
||||
<a href="
|
||||
<?php
|
||||
echo get_permalink(pll_get_post($page->ID, pll_current_language()) ?: $page->ID);
|
||||
?>
|
||||
"
|
||||
class="!no-underline w-full mt-[16px] items-center red-gradient-hover cursor-pointer flex text-[#f8f8f8] text-[16px] font-[600] justify-center h-[45px] w-[136px] rounded-[90px] flex items-center">
|
||||
Записаться
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<?php
|
||||
if (!is_front_page()) {
|
||||
@@ -130,47 +245,106 @@ if ($room === 'gym') {
|
||||
$style_attr = 'style="background-image: url(' . esc_attr($bg_image) . ')"';
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo $base_classes . ' ' . $body_classes . ' ' ?> pt-[161px]"
|
||||
<div class="<?php echo $base_classes . ' ' . $body_classes . ' ' ?> pt-[161px] max-[768px]:pt-[141px]"
|
||||
<?php echo $style_attr ?>
|
||||
>
|
||||
|
||||
<div class="container mx-auto pt-[32px] pb-[60px]">
|
||||
<div class="max-[768px]:pt-[20px] max-[768px]:pb-[32px] container mx-auto pt-[32px] pb-[60px]">
|
||||
<?php display_yandex_breadcrumbs(); ?>
|
||||
<?php if (!is_front_page()) : ?>
|
||||
<div class="container mx-auto mt-[24px]">
|
||||
<?php if (get_field('h1_text')): ?>
|
||||
<div class="flex justify-between flex-wrap gap-[12px]">
|
||||
<div class="flex flex-col">
|
||||
<h1 class="dark:text-[#f8f8f8] max-w-[900px] w-full text-[222] leading-[110%] text-[48px] font-[500]">
|
||||
<?php echo get_field('h1_text'); ?>
|
||||
</h1>
|
||||
<?php
|
||||
if (is_page('thank-you')) {
|
||||
?>
|
||||
<p class="font-[600] w-full max-w-[687px] text-[24px] leading-[125%] text-[#222] dark:text-[#f8f8f8] mt-[12px]">
|
||||
Очень скоро с вами свяжется наш отдел заботы, чтобы ответить на все
|
||||
интересующие
|
||||
вопросы.</p>
|
||||
<?php
|
||||
|
||||
$current_post_type = get_post_type();
|
||||
|
||||
if (is_post_type_archive() || ($current_post_type !== 'training' && $current_post_type !== 'trainer')) : ?>
|
||||
<div class="mt-[24px]">
|
||||
<?php
|
||||
$h1_text = '';
|
||||
$subtitle = '';
|
||||
$show_layout = false;
|
||||
|
||||
if (is_post_type_archive()) {
|
||||
$post_type = get_queried_object()->name;
|
||||
$h1_text = get_archive_field($post_type, 'h1_text');
|
||||
$subtitle = get_archive_field($post_type, 'subtitle');
|
||||
if ($h1_text) {
|
||||
$show_layout = true;
|
||||
}
|
||||
} elseif (get_field('h1_text')) {
|
||||
$h1_text = get_field('h1_text');
|
||||
$show_layout = true;
|
||||
}
|
||||
|
||||
if ($show_layout): ?>
|
||||
<div class="max-[768px]:gap-[16px] max-[768px]:[&>_img]:hidden flex justify-between flex-wrap gap-[12px]">
|
||||
<div class="flex flex-col">
|
||||
<h1 class="dark:text-[#f8f8f8] max-w-[900px] w-full text-[222] leading-[110%] max-[1330px]:text-[36px] max-[768px]:text-[32px] text-[48px] font-[500]">
|
||||
<?php echo $h1_text; ?>
|
||||
</h1>
|
||||
|
||||
<?php if ($subtitle): ?>
|
||||
<p class="font-[500] w-full max-w-[687px] text-[24px] leading-[125%] text-[#222] dark:text-[#f8f8f8] mt-[12px]">
|
||||
<?php echo esc_html($subtitle); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if (is_page('thank-you')) {
|
||||
?>
|
||||
<p class="font-[600] w-full max-w-[687px] text-[24px] leading-[125%] text-[#222] dark:text-[#f8f8f8] mt-[12px]">
|
||||
Очень скоро с вами свяжется наш отдел заботы, чтобы ответить на все
|
||||
интересующие
|
||||
вопросы.</p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if (!is_page('policy')) {
|
||||
if (is_post_type_archive('training')) {
|
||||
?>
|
||||
<div class="max-[768px]:flex-row max-[768px]:ml-0 ml-auto flex flex-col gap-[12px]">
|
||||
<div class="max-[768px]:min-w-[144px] max-[768px]:ml-0 max-[768px]:text-[24px] ml-auto flex gap-[10px] items-center">
|
||||
<div class="max-[768px]:text-[24px] font-[700] text-[48px] leading-[110%]"> 45+</div>
|
||||
<img class="max-[768px]:h-[32px] max-[768px]:w-[93px]" alt="decoration"
|
||||
src="<?php echo get_template_directory_uri() . '/assets/images/masonry-decor.png'; ?>">
|
||||
</div>
|
||||
<div class="max-[768px]:text-[14px] font-[500] text-[20px] leading-[140%]">
|
||||
групповых и персональных тренировок
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
display_icon(get_current_room() === 'gym' ? 'dark_logo_name' : 'light_logo_name');
|
||||
}
|
||||
}
|
||||
?></div>
|
||||
<?php display_icon(get_current_room() === 'gym' ? 'dark_logo_name' : 'light_logo_name'); ?>
|
||||
</div>
|
||||
<?php else:
|
||||
$title = trim(preg_replace('/\s*\([^)]*\)/', '', get_the_title()));
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
<?php else:
|
||||
$title = '';
|
||||
|
||||
<h1 class="dark:text-[#f8f8f8] text-[222] leading-[110%] text-[48px] font-[700]">
|
||||
<?php echo $title ?>
|
||||
</h1>
|
||||
if (is_post_type_archive()) {
|
||||
$post_type = get_queried_object()->name;
|
||||
$title = get_archive_field($post_type, 'h1_text');
|
||||
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
if (!$title) {
|
||||
$post_type_obj = get_queried_object();
|
||||
$title = $post_type_obj->labels->name;
|
||||
}
|
||||
} else {
|
||||
$title = trim(preg_replace('/\s*\([^)]*\)/', '', get_the_title()));
|
||||
}
|
||||
?>
|
||||
<h1 class="dark:text-[#f8f8f8] text-[222] leading-[110%] max-[1330px]:text-[36px] max-[768px]:text-[24px] text-[48px] font-[700]">
|
||||
<?php echo esc_html($title); ?>
|
||||
</h1>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user