Created
July 15, 2019 09:13
-
-
Save srueegger/a780ddc61381a9e8dd94bdcac8575f96 to your computer and use it in GitHub Desktop.
Adventure World Header.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html <?php language_attributes(); ?>> | |
<head> | |
<meta charset="<?php echo strtolower(get_bloginfo('charset')); ?>"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<?php | |
$meta_desc = __comp_trans('META_DESCRIPTION', false); | |
if(get_field('page_meta_desc', get_queried_object_id()) != ''): | |
$meta_desc = get_field('page_meta_desc', get_queried_object_id()); | |
endif; | |
if(trim($meta_desc) == ''): | |
$meta_desc = __comp_trans('META_DESCRIPTION', false); | |
endif; | |
?> | |
<meta name="description" content="<?php echo $meta_desc; ?>"> | |
<script type="text/javascript" src="https://cdns.gigya.com/JS/gigya.js?apikey=<?php the_field('setting_gigya_api_key', 'option'); ?>"> | |
{ | |
lang: '<?php echo ICL_LANGUAGE_CODE; ?>' | |
} | |
</script> | |
<?php wp_head(); ?> | |
</head> | |
<body <?php body_class(); ?>> | |
<header class="mainheader"> | |
<?php | |
$navbar_classes_array = array( | |
'navbar', | |
'navbar-expand-lg', | |
'animated', | |
'slideInDown', | |
'fast', | |
'dofix' | |
); | |
$brand_class_array = array( | |
'navbar-brand', | |
'small' | |
); | |
if(is_front_page()): | |
get_template_part( 'templates/header', 'animation' ); | |
$navbar_classes_array = array( | |
'navbar', | |
'navbar-expand-lg', | |
'd-none' | |
); | |
$brand_class_array = array( | |
'navbar-brand', | |
'd-none' | |
); | |
endif; | |
?> | |
<nav id="topnav-big" class="<?php echo implode(' ', $navbar_classes_array); ?>"> | |
<div class="mobile-menu-head-color"></div> | |
<div class="container h-100"> | |
<a class="<?php echo implode(' ', $brand_class_array); ?>" href="<?php echo HOME_URI; ?>"> | |
<picture> | |
<source type="image/webp" srcset="<?php echo THEME_IMAGES; ?>/logo@2x.webp 2x, <?php echo THEME_IMAGES; ?>/logo.webp 1x"> | |
<source type="image/png" srcset="<?php echo THEME_IMAGES; ?>/logo@2x.png 2x, <?php echo THEME_IMAGES; ?>/logo.png 1x"> | |
<img src="<?php echo THEME_IMAGES; ?>/logo.png" alt="Logo Adventure World"> | |
</picture> | |
</a> | |
<button class="navbar-toggler hamburger hamburger--vortex" type="button" aria-controls="mobilemenu" aria-expanded="false" aria-label="Toggle navigation"> | |
<span class="hamburger-box"> | |
<span class="hamburger-inner"></span> | |
</span> | |
</button> | |
<button class="mobile-loginbutton d-block d-lg-none btn btn-secondary" data-toggle="modal" data-target="#loginModal"><?php __comp_trans('Login'); ?></button> | |
<i class="far fa-user text-secondary usericon d-none"></i> | |
<div class="collapse navbar-collapse h-100" id="mainmenu"> | |
<?php | |
$menu_left = array( | |
'theme_location' => 'main-menu-left', | |
'depth' => 2, | |
'container' => false, | |
'items_wrap' => '%3$s', | |
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback', | |
'walker' => new WP_Bootstrap_Navwalker(), | |
); | |
$menu_right = array( | |
'theme_location' => 'main-menu-right', | |
'depth' => 2, | |
'container' => false, | |
'items_wrap' => '%3$s', | |
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback', | |
'walker' => new WP_Bootstrap_Navwalker(), | |
); | |
echo '<ul class="navbar-nav mr-auto">'; | |
wp_nav_menu($menu_left); | |
echo '<li class="menu-item"><a data-toggle="modal" data-target="#infoModal" class="nav-link border-0 infoicon" href="javascript:void(0)"><span>i</span></a></li>'; | |
echo '</ul>'; | |
echo '<ul class="navbar-nav ml-auto">'; | |
wp_nav_menu($menu_right); | |
echo '</ul>'; | |
?> | |
</div> | |
<div class="ml-3 sbb-logo"> | |
<span class="smalltxt d-block">Main Partner</span> | |
<?php | |
$sbb_link = 'https://sbb.ch/freizeit'; | |
if(ICL_LANGUAGE_CODE == 'fr'): | |
$sbb_link = 'https://cff.ch/loisirs'; | |
elseif(ICL_LANGUAGE_CODE == 'it'): | |
$sbb_link = 'https://ffs.ch/tempolibero'; | |
endif; | |
?> | |
<a href="<?php echo $sbb_link; ?>" target="_blank"> | |
<picture> | |
<img src="<?php echo THEME_IMAGES; ?>/sbblogo.svg" alt="SBB Logo"> | |
</picture> | |
</a> | |
</div> | |
</div> | |
</nav> | |
<?php | |
if(is_front_page()): | |
get_template_part( 'templates/header', 'seo' ); | |
endif; | |
?> | |
</header> | |
<?php | |
get_sidebar( 'mobilemenu' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment