-
Notifications
You must be signed in to change notification settings - Fork 6
/
header.php
54 lines (44 loc) · 1.85 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
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<?php Tofino\Init\alerts('top'); ?>
<header class="<?php echo Tofino\Init\menu_sticky(); ?>">
<nav class="flex justify-between w-full px-6 py-4 bg-gray-100">
<a href="<?php echo home_url(); ?>" title="<?php echo esc_attr(bloginfo('name')); ?>">
<?php echo bloginfo('name'); ?>
</a>
<button class="flex lg:hidden js-menu-toggle" aria-controls="main-menu" aria-expanded="false" aria-label="Toggle navigation" data-cy="open-mobile-menu">
<!-- Hamburger Icon -->
<span class="w-6 h-6">
<?php echo svg(['sprite' => 'icon-hamburger', 'class' => 'w-full h-full']); ?>
</span>
<span class="sr-only"><?php _e('Toggle Navigation Button', 'tofino'); ?></span>
</button>
<div class="inactive absolute inset-0 bg-white lg:bg-transparent w-full h-screen lg:h-auto lg:relative lg:w-auto lg:flex lg:items-center" id="main-menu">
<!-- Close Icon -->
<button class="absolute z-10 w-4 h-4 top-5 right-7 lg:hidden js-menu-toggle"
data-cy="close-mobile-menu"
>
<?php echo svg(['sprite' => 'icon-close', 'class' => 'w-full h-full']); ?>
</button>
<?php if (has_nav_menu('header_navigation')):
wp_nav_menu([
'menu' => 'nav_menu',
'theme_location' => 'header_navigation',
'depth' => 2,
'container' => '',
'container_class' => '',
'container_id' => '',
'menu_class' => 'navbar-nav',
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
]);
endif; ?>
</div>
</nav>
</header>