-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathheader.php
executable file
·95 lines (93 loc) · 3.5 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
/**
* The header for our theme
*
* Displays all of the <head> section, wrapper, logo, and main navigation.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Basetheme
* @since 1.0
* @version 2.7
*/
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php
/**
* Output "Custom Scripts (after body tag)" from the admin Site Settings.
*/
get_template_part( 'template-parts/header/part', 'bodyscripts' );
?>
<div id="wrapper">
<a href="#site-main" class="sr-only sr-only-focusable skipnav"><?php esc_attr_e( 'Skip to main content', 'basetheme' ); ?></a>
<?php get_template_part( 'template-parts/header/part', 'alert' ); ?>
<header id="site-header">
<div class="container-wide container-md-none">
<?php if ( function_exists( 'get_field' ) && get_field( 'logo', 'options' ) ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo get_bloginfo( 'name', 'display' ); ?>" rel="Home" class="logo-set" aria-label="<?php echo get_bloginfo( 'name', 'display' ); ?> logo">
<span class="logo"><?php echo bt_load_svg_from_media( get_field( 'logo', 'options' )['url'] ); ?></span>
</a>
<?php endif; ?>
<?php
$utility_nav = wp_nav_menu(
array(
'echo' => false,
'theme_location' => 'site-header-utility-nav',
'depth' => 1,
'container' => 'nav',
'container_class' => 'nav-container',
'container_id' => 'site-header-utility-nav-container',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker(),
)
);
$main_nav = wp_nav_menu(
array(
'echo' => false,
'theme_location' => 'site-header-main-nav',
'depth' => 2,
'container' => 'nav',
'container_class' => 'nav-container',
'container_id' => 'site-header-main-nav-container',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker(),
)
);
?>
<?php if ( $utility_nav || $main_nav ) : ?>
<div class="navbar navbar-expand-lg" role="navigation" id="site-header-navbar-container">
<div id="site-header-nav-menus" class="collapse navbar-collapse">
<?php
if ( $main_nav ) :
echo $main_nav;
endif;
?>
<?php
if ( $utility_nav ) :
echo $utility_nav;
endif;
?>
</div>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#site-header-nav-menus" aria-controls="header-nav-menus" aria-expanded="false" aria-label="Toggle navigation">
<svg width="30px" height="21px" viewBox="0 0 30 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect class="navbar-bars-top" x="1" y="9" width="28" height="3" rx="2" transform="translate(0, -9)"></rect>
<rect class="navbar-bars-middle" x="1" y="9" width="28" height="3" rx="2"></rect>
<rect class="navbar-bars-btm" x="1" y="9" width="28" height="3" rx="2" transform="translate(0, 9)"></rect>
</svg>
</button>
<?php endif; ?>
</div>
</header>
<main id="site-main">