/home/bdqbpbxa/demo-subdomains/lafinteca.goodface.com.ua/wp-content/themes/lafinteca/header.php
<!DOCTYPE html>
<html lang="<? echo pll_current_language(); ?>">
<head>
<title>
<?php echo wp_get_document_title(); ?>
</title>
<meta charset="utf-8">
<link rel="canonical" href="<?php echo get_the_permalink(); ?>">
<!-- Mobile -->
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<!-- Schema -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "LaFinteca",
"url": "https://www.la-finteca.com/"
}
</script>
<!-- Organizations schema -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "LaFinteca",
"url": "https://www.la-finteca.com/",
"logo": "https://www.la-finteca.com/wp-content/uploads/2023/10/logo.svg",
"email": "info@la-finteca.com ",
"sameAs": [ "https://www.facebook.com/profile.php?id=61550918667556", "https://instagram.com/lafinteca", "https://www.linkedin.com/company/98638215/admin/feed/posts/?feedType=following", "https://twitter.com/LaFinteca"]
}
}
</script>
<?php wp_head(); ?>
</head>
<body>
<style>
.preloader {
position: fixed;
z-index: 500;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: block;
background: #181818;
overflow: hidden;
opacity: 0;
pointer-events: none;
transition: opacity 0.4s;
}
.preloader.-visible {
opacity: 1;
pointer-events: auto;
padding-right: 17px;
}
.preloader-img {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: block;
width: min(1000px, 120%);
height: min(800px, 120%);
}
.preloader-img lottie-player {
display: block;
width: 100%;
height: 100%;
}
</style>
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
<div class="preloader -visible">
<div class="preloader-img">
<lottie-player src="<?php echo get_template_directory_uri(); ?>/assets/images/preloader.json" background="transparent" speed="1" loop autoplay></lottie-player>
</div>
</div>
<script>
function lockScroll(isFirstScreenHack = false) {
const html = document.documentElement;
const body = document.body;
let scrollTop = window.scrollY;
if (isFirstScreenHack) {
scrollTop = scrollTop + $('.-delete-after-animate').innerhHeight();
}
html.classList.add('-scroll-lock');
body.classList.add('-scroll-lock');
document.body.scrollTo(0, scrollTop);
html.setAttribute('data-scroll', scrollTop);
}
// Allow animations if JS support is enabled
document.body.classList.add('-allow-animations');
// Don't show preloader again if the page was visited
let preloader = document.querySelector('.preloader');
let fullPageUrl = window.location.href;
let visitedPages = window.localStorage.getItem('visited-pages');
if (preloader && visitedPages) {
preloader.remove();
} else if (preloader) {
lockScroll();
preloader.classList.add('-visible');
}
window.addEventListener('load', function() {
window.localStorage.setItem('visited-pages', true);
});
</script>
<?php
$curr_lang = pll_current_language();
$header = get_field("header-{$curr_lang}", 'option');
?>
<header class="header">
<div class="container">
<div class="header__wrapper">
<?php
$logo = get_field('logo', 'option');
?>
<?php
$additional_slash = $curr_lang == 'en' ? '' : '/';
?>
<a href="<?php echo get_home_url() . $additional_slash; ?>" class="logo"><img src="<?php echo $logo['url']; ?>" alt="<?php echo $logo['alt']; ?>" /></a>
<div class="header__menu">
<?php
foreach($header['navigation'] as $item) :
if ($item['is_dropdown'] && $item['dropdown_name']) :
?>
<div class="header__dropdown <?php if ($item['make_images_rounded_in_this_dropdown']) echo '-rounded-img'; ?>">
<?php
$dropdown_link = get_link_group_field($item['dropdown_link']);
if (!$dropdown_link) :
?>
<span class="default-link header__dropdown-opener --cursor-pointer"><?php echo $item['dropdown_name']; ?></span>
<?php
else :
?>
<a href="<?php echo $dropdown_link['url'] ?>" <?php echo $dropdown_link['target'] ?> class="default-link header__dropdown-opener --cursor-pointer"><?php echo $item['dropdown_name']; ?></a>
<?php
endif;
?>
<div class="header__dropdown-content">
<?php
$is_to_one_page = $item['make_links_in_dropdown_to_one_page'];
foreach($item['dropdown_list'] as $link) :
$prepared_link = get_link_group_field($link['link']);
if ($is_to_one_page && $item['page_link'] && $prepared_link) {
$is_no_id = is_404() || $item['page_link']->ID != $post->ID;
if ($is_no_id && $prepared_link['url'] != get_the_permalink($item['page_link']->ID)) {
$prepared_link['url'] = get_the_permalink($item['page_link']->ID) . $prepared_link['url'];
}
}
if ($prepared_link) :
?>
<a href="<?php echo $prepared_link['url']; ?>" <?php echo $prepared_link['target']; ?> class="default-link <?php if ($link['link']['coming_soon']) echo '-disabled'; ?>">
<?php
if ($link['link']['image']) :
?>
<img src="<?php echo $link['link']['image']['url']; ?>" alt="<?php echo $link['link']['image']['alt']; ?>" />
<?php
endif;
?>
<?php echo $prepared_link['title']; ?>
<?php
if ($link['link']['coming_soon']) :
?>
<span class="--soon">(SOON)</span>
<?php
endif;
?>
</a>
<?php
endif;
endforeach;
?>
</div>
</div>
<?php
else :
$prepared_link = get_link_group_field($item['link']);
if ($prepared_link) :
?>
<a href="<?php echo $prepared_link['url']; ?>" <?php echo $prepared_link['target']; ?> class="default-link <?php if ($prepared_link['target']) echo '-external'; ?>"><?php echo $prepared_link['title']; ?></a>
<?php
endif;
endif;
endforeach;
?>
</div>
<?php
$header_button = get_link_group_field($header['login_button']);
if ($header_button) :
?>
<a href="<?php echo $header_button['url'] ?>" <?php echo $header_button['target'] ?> class="default-button -transparent"><?php echo $header_button['title'] ?></a>
<?php
endif;
?>
<div class="burger">
<span></span><span></span>
</div>
</div>
</div>
<div class="mobile-menu">
<?php
if ($header_button) :
?>
<a href="<?php echo $header_button['url'] ?>" <?php echo $header_button['target'] ?> class="default-button -transparent"><?php echo $header_button['title'] ?></a>
<?php
endif;
?>
<div class="mobile-menu_inner">
<?php
foreach($header['navigation'] as $item) :
if ($item['is_dropdown'] && $item['dropdown_name']) :
?>
<div class="header__dropdown <?php if ($item['make_images_rounded_in_this_dropdown']) echo '-rounded-img'; ?>">
<span class="default-link header__dropdown-opener --cursor-pointer"><?php echo $item['dropdown_name']; ?></span>
<div class="header__dropdown-content">
<div class="header__dropdown-content-inner">
<?php
$is_to_one_page = $item['make_links_in_dropdown_to_one_page'];
foreach($item['dropdown_list'] as $link) :
$prepared_link = get_link_group_field($link['link']);
if ($is_to_one_page && $item['page_link'] && $prepared_link) {
$is_no_id = is_404() || $item['page_link']->ID != $post->ID;
if ($is_no_id && $prepared_link['url'] != get_the_permalink($item['page_link']->ID)) {
$prepared_link['url'] = get_the_permalink($item['page_link']->ID) . $prepared_link['url'];
}
}
if ($prepared_link) :
?>
<a href="<?php echo $prepared_link['url']; ?>" <?php echo $prepared_link['target']; ?> class="default-link <?php if ($link['link']['coming_soon']) echo '-disabled'; ?>">
<?php
if ($link['link']['image']) :
?>
<img src="<?php echo $link['link']['image']['url']; ?>" alt="<?php echo $link['link']['image']['alt']; ?>" />
<?php
endif;
?>
<?php echo $prepared_link['title']; ?>
<?php
if ($link['link']['coming_soon']) :
?>
<span class="--soon">(SOON)</span>
<?php
endif;
?>
</a>
<?php
endif;
endforeach;
?>
</div>
</div>
</div>
<?php
else :
$prepared_link = get_link_group_field($item['link']);
if ($prepared_link) :
?>
<a href="<?php echo $prepared_link['url']; ?>" <?php echo $prepared_link['target']; ?> class="default-link <?php if ($prepared_link['target']) echo '-external'; if ($link['link']['coming_soon']) echo '-disabled'; ?>"><?php echo $prepared_link['title']; ?></a>
<?php
endif;
endif;
endforeach;
?>
</div>
<div class="mobile-menu__bottom">
<?php
$social_list = get_field('contacts', 'option')['socials_list'];
?>
<div class="socials-list">
<?php
foreach($social_list as $item) :
if ($item['link'] && $item['icon']) :
?>
<a href="<?php echo $item['link']; ?>" target="_blank"><img src="<?php echo $item['icon']['url']; ?>" alt="<?php echo $item['icon']['alt']; ?>" /></a>
<?php
endif;
endforeach;
?>
</div>
<?php
$languages = pll_the_languages([
'raw' => true,
]);
?>
<div class="language-dropdown">
<div class="language-dropdown__visible">
<?php echo pll_current_language('name'); ?>
</div>
<div class="language-dropdown__content">
<?php
foreach( $languages as $lang) :
?>
<a href="<?php echo $lang['url']; ?>" class="<?php if ($lang['slug'] == $curr_lang) echo '-disabled'; ?>"><?php echo $lang['name']; ?></a>
<?php
endforeach;
?>
</div>
</div>
</div>
</div>
</header>