194 lines
11 KiB
PHP
194 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://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<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' );
|
|
$foto_mob_id = carbon_get_post_meta( $post_id, 'banner_img_mobile' );
|
|
if ( ! $foto_mob_id ) $foto_mob_id = $foto_id;
|
|
|
|
$banner_desk = $foto_id ? wp_get_attachment_url( $foto_id ) : '';
|
|
$banner_mob = $foto_mob_id ? wp_get_attachment_url( $foto_mob_id ) : '';
|
|
|
|
if ( $banner_desk ) {
|
|
echo '<link rel="preload" as="image" href="' . esc_url( $banner_desk ) . '" media="(min-width: 860px)" fetchpriority="high">' . "\n";
|
|
}
|
|
if ( $banner_mob && $banner_mob !== $banner_desk ) {
|
|
echo '<link rel="preload" as="image" href="' . esc_url( $banner_mob ) . '" media="(max-width: 859px)" 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>
|
|
<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 if ( function_exists( 'needs_swiper' ) && needs_swiper() ) : ?>
|
|
<link rel="preload" as="style"
|
|
href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css"
|
|
onload="this.onload=null;this.rel='stylesheet'">
|
|
<noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css"></noscript>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
// Google Fonts
|
|
?>
|
|
<link rel="preload" as="style"
|
|
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700;900&family=Oswald:wght@400;500;600;700&display=swap"
|
|
onload="this.onload=null;this.rel='stylesheet'">
|
|
<noscript><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700;900&family=Oswald:wght@400;500;600;700&display=swap"></noscript>
|
|
|
|
<?php
|
|
|
|
?>
|
|
|
|
|
|
<?php if ( function_exists( 'needs_swiper' ) && needs_swiper() ) : ?>
|
|
<script src="https://cdn.jsdelivr.net/npm/swiper@9/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( 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>
|