You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

112 lines
3.9 KiB

<?php header("Last-Modified: " . get_the_modified_date('r'))?>
<?php
/**
* The Header template for our theme
*/
global $site_work_mode;
global $main_host;
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<link rel="profile" href="https://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
<?if($site_work_mode == 'production'):?>
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(96481053, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/96481053" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<script>
mindbox = window.mindbox || function() { mindbox.queue.push(arguments); };
mindbox.queue = mindbox.queue || [];
mindbox('create');
</script>
<script src="https://api.mindbox.ru/scripts/v1/tracker.js" async></script>
<!-- Roistat Counter Start -->
<script>
(function(w, d, s, h, id) {
w.roistatProjectId = id; w.roistatHost = h;
var p = d.location.protocol == "https:" ? "https://" : "http://";
var u = /^.*roistat_visit=[^;]+(.*)?$/.test(d.cookie) ? "/dist/module.js" : "/api/site/1.0/"+id+"/init?referrer="+encodeURIComponent(d.location.href);
var js = d.createElement(s); js.charset="UTF-8"; js.async = 1; js.src = p+h+u; var js2 = d.getElementsByTagName(s)[0]; js2.parentNode.insertBefore(js, js2);
})(window, document, 'script', 'cloud.roistat.com', 'deb599063344e761d81d2ef6420fd8fc');
</script>
<!-- Roistat Counter End -->
<?else:?>
<? // GP| Замена относительных ссылок изображений, на абсолютные к боевому сайту?>
<script>
document.addEventListener("DOMContentLoaded", function() {
document.querySelectorAll('img').forEach(img => { // во всех src у img, в которых есть /upload/
img.attributes['src'].value = img.attributes['src'].value.replace('cosmopet.good-production.xyz', '<?=$main_host?>')
if (img.attributes['srcset']){
img.attributes['srcset'].value = img.attributes['srcset'].value.replace('cosmopet.good-production.xyz', '<?=$main_host?>')
}
})
});
</script>
<?endif;?>
</head>
<style>
.wd-nav-img {
max-height: 40px!important;
margin-right: 0;
}
.cart-desktop {
display: none!important;
}
.account-desktop{
display: none!important;;
}
.cart-mobile {
display: flex;
}
.account-mobile{
display: flex;
}
</style>
<?if(!is_page('gp-test')): // заменить на is_front_page()?>
<body <?php body_class(); ?>>
<?php if ( function_exists( 'wp_body_open' ) ) : ?>
<?php wp_body_open(); ?>
<?php endif; ?>
<?php do_action( 'woodmart_after_body_open' ); ?>
<div class="website-wrapper">
<?php if ( woodmart_needs_header() ) : ?>
<?php if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'header' ) ) : ?>
<header <?php woodmart_get_header_classes(); // phpcs:ignore ?>>
<?php whb_generate_header(); ?>
</header>
<?php endif ?>
<?php woodmart_page_top_part(); ?>
<?php endif ?>
<?else:?>
<? // GP | Здесь подключить через require_once шаблон для <header> ?>
<? require_once(get_template_directory() . '/gp-include/new-header.php'); ?>
<?endif;?>