-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
68 lines (59 loc) · 1.41 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* The header for the theme
*
*/
$hasHero = get_field('has_hero', $post->ID);
$maxWidth = get_theme_mod('site-max-width', '1280px');
$hasSiteMax = $maxWidth != 'none';
$classes = [];
if($hasHero) $classes[] = 'has-hero';
if($hasSiteMax) {
$classes[] = 'has-max-width';
$classes[] = 'site-max-' . $maxWidth;
}
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
:root {
--site-max: <?= $maxWidth ?>;
}
</style>
<?php wp_head(); ?>
</head>
<body <?php body_class( $classes ); ?>>
<a class="screen-reader-text" href="#content">Skip to content</a>
<header class="site-header">
<div class="inner">
<div class="site-logo">
<a href="<?php print site_url() ?>">
<?php include('assets/svg/bbi-logo.svg') ?>
</a>
</div>
<nav class="main-navigation">
<?php
wp_nav_menu( array(
'theme_location' => 'main-menu',
'menu_id' => 'primary-menu',
) );
?>
</nav>
<button class="mobile-nav-btn">
<div class="line line1"></div>
<div class="line line2"></div>
<div class="line line3"></div>
</button>
</div>
</header>
<?php
if( $hasHero ) :
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/components/hero' );
endwhile;
endif;
?>
<div id="content" class="site-content">