195 lines
11 KiB
PHP
195 lines
11 KiB
PHP
<!doctype html>
|
|
<html <?php language_attributes(); ?>>
|
|
<head>
|
|
<meta charset="<?php bloginfo('charset'); ?>">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<?php
|
|
?>
|
|
|
|
<link rel="preconnect" href="https://cdn-ru.bitrix24.ru">
|
|
<link rel="preconnect" href="https://alee.bitrix24.ru" crossorigin>
|
|
<link rel="preconnect" href="https://cdn.jsdelivr.net">
|
|
<link rel="dns-prefetch" href="//api-maps.yandex.ru">
|
|
<link rel="dns-prefetch" href="//mod.gudok.tel">
|
|
<?php
|
|
// ─────────────────────────────────────────────────────────────────────
|
|
// PRELOAD 1
|
|
// ─────────────────────────────────────────────────────────────────────
|
|
?>
|
|
<link rel="preload" as="image"
|
|
href="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/logo-svg.svg"
|
|
type="image/svg+xml">
|
|
|
|
<?php
|
|
// ─────────────────────────────────────────────────────────────────────
|
|
// PRELOAD LCP: podgotovka-k-shkole
|
|
// ─────────────────────────────────────────────────────────────────────
|
|
if (is_page_template('page-podgotovka-k-shkole.php')) {
|
|
$pksh_img_id = carbon_get_post_meta(get_the_ID(), 'banner_image');
|
|
if ($pksh_img_id) {
|
|
$pksh_img_url = wp_get_attachment_url($pksh_img_id);
|
|
if ($pksh_img_url) {
|
|
echo '<link rel="preload" as="image" href="' . esc_url($pksh_img_url) . '" fetchpriority="high">' . "\n";
|
|
}
|
|
}
|
|
}
|
|
|
|
// ─────────────────────────────────────────────────────────────────────
|
|
// PRELOAD LCP: front page
|
|
// ─────────────────────────────────────────────────────────────────────
|
|
if (is_front_page()) {
|
|
$post_id = get_the_ID();
|
|
$foto_id = carbon_get_post_meta($post_id, 'banner_img_desktop');
|
|
$banner_src = $foto_id ? wp_get_attachment_url($foto_id) : '';
|
|
|
|
if ($banner_src) {
|
|
echo '<link rel="preload" as="image" href="' . esc_url($banner_src) . '" fetchpriority="high">' . "\n";
|
|
}
|
|
}
|
|
?>
|
|
|
|
<?php
|
|
// ─────────────────────────────────────────────────────────────────────
|
|
// CSS12
|
|
// ─────────────────────────────────────────────────────────────────────
|
|
?>
|
|
<style id="reset-css-inline">/*! reset.css inline */ *{margin:0;padding:0;box-sizing:border-box}html{scroll-behavior:smooth}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}img{max-width:100%;height:auto;display:block}a{color:inherit;text-decoration:none}button{cursor:pointer;font:inherit}ul,ol{list-style:none}table{border-collapse:collapse}input,textarea,select{font:inherit}</style>
|
|
|
|
<?php if (is_front_page()) :
|
|
$critical_css_path = get_template_directory() . '/assets/css/critical-home.css';
|
|
if (file_exists($critical_css_path)) {
|
|
$critical_css = file_get_contents($critical_css_path);
|
|
echo '<style id="critical-front-css">' . $critical_css . '</style>' . "\n";
|
|
}
|
|
$main_css_url = get_template_directory_uri() . '/assets/css/main.css?ver=' . filemtime(get_template_directory() . '/assets/css/main.css');
|
|
?><link rel="preload" as="style" href="<?php echo esc_url($main_css_url); ?>" onload="this.onload=null;this.rel='stylesheet'">
|
|
<noscript><link rel="stylesheet" href="<?php echo esc_url($main_css_url); ?>"></noscript>
|
|
<?php else : ?>
|
|
<link rel="stylesheet" href="<?php echo esc_url(get_template_directory_uri() . '/assets/css/main.css?ver=' . filemtime(get_template_directory() . '/assets/css/main.css')); ?>" media="all">
|
|
<?php endif; ?>
|
|
|
|
<?php if (function_exists('needs_swiper') && needs_swiper()) : ?>
|
|
<link rel="preload" as="style"
|
|
href="<?php echo esc_url(get_template_directory_uri() . '/assets/vendor/swiper/swiper-bundle.min.css'); ?>"
|
|
onload="this.onload=null;this.rel='stylesheet'">
|
|
<noscript><link rel="stylesheet" href="<?php echo esc_url(get_template_directory_uri() . '/assets/vendor/swiper/swiper-bundle.min.css'); ?>"></noscript>
|
|
<?php endif; ?>
|
|
|
|
<link rel="preload" as="style" href="<?php echo esc_url(get_template_directory_uri() . '/assets/css/fonts.css?ver=' . filemtime(get_template_directory() . '/assets/css/fonts.css')); ?>" onload="this.onload=null;this.rel='stylesheet'">
|
|
<noscript><link rel="stylesheet" href="<?php echo esc_url(get_template_directory_uri() . '/assets/css/fonts.css?ver=' . filemtime(get_template_directory() . '/assets/css/fonts.css')); ?>"></noscript>
|
|
<?php
|
|
|
|
?>
|
|
|
|
|
|
<?php if (function_exists('needs_swiper') && needs_swiper()) : ?>
|
|
<script src="<?php echo esc_url(get_template_directory_uri() . '/assets/vendor/swiper/swiper-bundle.min.js'); ?>" defer></script>
|
|
<?php endif; ?>
|
|
<script src="<?php echo esc_url(get_template_directory_uri() . '/assets/js/add.js?ver=' . filemtime(get_template_directory() . '/assets/js/add.js')); ?>" defer></script>
|
|
|
|
<?php wp_head(); ?>
|
|
</head>
|
|
|
|
<body <?php body_class(); ?>>
|
|
<?php if (function_exists('wp_body_open')) {
|
|
wp_body_open();
|
|
} ?>
|
|
|
|
<header class="header">
|
|
<nav class="header-nav" aria-label="Основная навигация">
|
|
<div class="top-header-row">
|
|
|
|
<a class="header-logo" href="<?php echo esc_url(home_url('/')); ?>">
|
|
<img width="136" height="40"
|
|
src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/logo-svg.svg"
|
|
alt="<?php esc_attr_e('Декарт — частная школа в Щелково', 'dekart'); ?>"
|
|
loading="eager">
|
|
</a>
|
|
|
|
<div class="mobile icon-links">
|
|
<a href="<?php echo esc_url(carbon_get_theme_option('social_header_wt')); ?>"
|
|
target="_blank" rel="noopener noreferrer"
|
|
aria-label="Написать в WhatsApp">
|
|
<img width="18" height="18"
|
|
src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/icon-whatsapp-w.svg"
|
|
alt="WhatsApp" loading="lazy">
|
|
</a>
|
|
<a href="tel:<?php echo preg_replace('/[^0-9+]/', '', carbon_get_theme_option('site_phone')); ?>"
|
|
aria-label="Позвонить нам">
|
|
<img width="18" height="18"
|
|
src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/phone-volume.svg"
|
|
alt="Телефон" loading="lazy">
|
|
</a>
|
|
<a href="<?php echo esc_url(carbon_get_theme_option('site_lk_url') ?: 'https://lk.dekart-school.ru/'); ?>" target="_blank" rel="noopener noreferrer"
|
|
aria-label="Личный кабинет">
|
|
<img width="18" height="18"
|
|
src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/icon-user-w.svg"
|
|
alt="Личный кабинет" loading="lazy">
|
|
</a>
|
|
<button class="burger-btn"
|
|
aria-label="<?php esc_attr_e('Открыть меню', 'dekart'); ?>"
|
|
aria-expanded="false"
|
|
aria-controls="main-menu">
|
|
<span></span><span></span><span></span>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="add-menu desktop">
|
|
<div class="add-menu_item">
|
|
<img width="15" height="25"
|
|
src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/icon-location.svg"
|
|
alt="Адрес" loading="lazy">
|
|
<span><?php echo esc_html(get_option('branch_address') ?: carbon_get_theme_option('site_address')); ?></span>
|
|
</div>
|
|
<a target="_blank" rel="noopener noreferrer"
|
|
href="<?php echo esc_url(carbon_get_theme_option('social_header_wt')); ?>"
|
|
style="margin-right:-15px"
|
|
aria-label="Написать в WhatsApp">
|
|
<img width="19" height="21"
|
|
src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/icon-whatsap.svg"
|
|
alt="WhatsApp" loading="lazy">
|
|
</a>
|
|
<a class="add-menu_item header-tel"
|
|
href="tel:<?php echo preg_replace('/[^0-9+]/', '', carbon_get_theme_option('site_phone')); ?>">
|
|
<span><?php echo esc_html(carbon_get_theme_option('site_phone')); ?></span>
|
|
</a>
|
|
<button class="btn-free-lesson-header btn-primary desktop btn-write">
|
|
<?php esc_html_e('Записаться на бесплатное', 'dekart'); ?>
|
|
</button>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="bottom-header-row">
|
|
<div class="menu-wrapper" id="main-menu" role="navigation">
|
|
<img width="42" height="42"
|
|
class="icon-close-menu btn-close-header-menu mobile"
|
|
src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/btn-close-modal_.svg"
|
|
alt="<?php esc_attr_e('Закрыть меню', 'dekart'); ?>"
|
|
loading="lazy">
|
|
<?php
|
|
wp_nav_menu(array(
|
|
'menu' => 'Основное меню',
|
|
'menu_class' => 'header-menu',
|
|
'theme_location' => 'top',
|
|
));
|
|
?>
|
|
<button class="btn-free-lesson-header btn-primary mobile btn-write">
|
|
<?php esc_html_e('Записаться на бесплатное', 'dekart'); ?>
|
|
</button>
|
|
<button class="btn-close-menu btn-close-header-menu mobile">
|
|
<?php esc_html_e('ЗАКРЫТЬ МЕНЮ', 'dekart'); ?>
|
|
</button>
|
|
</div>
|
|
<a class="inter-lk desktop" href="<?php echo esc_url(carbon_get_theme_option('site_lk_url') ?: 'https://lk.dekart-school.ru/'); ?>" target="_blank" rel="noopener noreferrer">
|
|
<img width="18" height="23"
|
|
src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/icon-user.svg"
|
|
alt="Личный кабинет" loading="lazy">
|
|
<span><?php esc_html_e('Личный кабинет', 'dekart'); ?></span>
|
|
</a>
|
|
</div>
|
|
|
|
</nav>
|
|
</header>
|