This repository has been archived by the owner on Aug 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
171 lines (160 loc) · 5.17 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
/**
* The template for displaying the header
*
* @package neumorphic
*/
?>
<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#" <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
} else {
do_action( 'wp_body_open' );
}
?>
<?php if ( ! is_page_template( 'template/flat.php' ) ) : ?>
<header class="header" role="banner">
<div class="container">
<div class="header__inner">
<div class="header__brand">
<?php
// Header logo
if ( has_custom_logo() ) :
$logo_class = 'header__brand-logo';
if ( get_theme_mod( 'site_logo_nm_style', NEUMORPHIC_SITE_LOGO_NM_STYLE ) ) {
$logo_class .= ' header__brand-logo--nm';
}
?>
<div class="<?php echo esc_attr( $logo_class ); ?>">
<?php the_custom_logo(); ?>
</div>
<?php endif; ?>
<?php if ( is_front_page() || is_home() ) : ?>
<h1 class="header__brand-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
<p class="header__brand-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
<?php endif; ?>
<?php
$description = get_bloginfo( 'description', 'display' );
if ( $description ) :
?>
<p class="header__brand-description"><span><?php echo esc_html( $description ); ?></span></p>
<?php endif; ?>
</div>
<?php
// Header search bar
if ( true === get_theme_mod( 'header_search_display', NEUMORPHIC_HEADER_SEARCH_DISPLAY ) ) :
?>
<div class="header__search">
<?php get_search_form(); ?>
</div>
<?php endif; ?>
<?php
// SNS icon
if ( true === get_theme_mod( 'header_sns_display', NEUMORPHIC_HEADER_SNS_DISPLAY ) ) :
?>
<nav class="header__sns" role="navigation" aria-label="<?php esc_attr_e( 'Header SNS Links', 'neumorphic' ); ?>">
<div class="container">
<?php get_template_part( 'parts/sns' ); ?>
</div>
</nav>
<?php endif; ?>
<?php
// Global menu
if ( has_nav_menu( 'primary' ) ) :
?>
<div class="gnav">
<nav class="c-gnav" role="navigation" aria-hidden="true" aria-label="<?php esc_attr_e( 'Global menu', 'neumorphic' ); ?>">
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'menu_class' => 'c-gnav__list',
'container' => false,
'walker' => new Neumorphic_Gnav_Walker(),
)
);
?>
</nav>
</div>
<?php endif; ?>
</div>
</div>
</header>
<?php endif; ?>
<?php
// Fixed global menu
if ( has_nav_menu( 'primary' ) ) :
?>
<div id="fixed_gnav" class="fixed-gnav">
<div class="container">
<nav class="c-gnav" role="navigation" aria-hidden="true" aria-label="<?php esc_attr_e( 'Fixed global menu', 'neumorphic' ); ?>">
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'menu_class' => 'c-gnav__list',
'container' => false,
'walker' => new Neumorphic_Gnav_Walker(),
)
);
?>
</nav>
</div>
</div>
<?php endif; ?>
<nav class="fixed-nav" aria-label="<?php esc_attr_e( 'Fixed mobile menu', 'neumorphic' ); ?>">
<ul class="fixed-nav__list">
<li class="fixed-nav__item">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><i class="fas fa-home" title="<?php esc_attr_e( 'Home', 'neumorphic' ); ?>"></i></a>
</li>
<?php
// Drawer menu open/close button
if ( has_nav_menu( 'mobile' ) ) :
?>
<li class="fixed-nav__item">
<button id="mobile_hm_btn" aria-controls="drawer" aria-expanded="false" aria-label="<?php esc_attr_e( 'Open / Close mobile menu', 'neumorphic' ); ?>"><i class="fas fa-bars"></i></button>
</li>
<?php endif; ?>
<li class="fixed-nav__item">
<a href="#"><i class="fas fa-arrow-up" title="<?php esc_attr_e( 'Scroll to top', 'neumorphic' ); ?>"></i></a>
</li>
</ul>
</nav>
<?php if ( has_nav_menu( 'mobile' ) ) : ?>
<nav id="drawer" class="drawer" aria-hidden="true" aria-label="<?php esc_attr_e( 'Mobile menu', 'neumorphic' ); ?>">
<div class="drawer__inner container">
<button id="mobile_close_btn" class="drawer__close" aria-controls="drawer" aria-label="<?php esc_attr_e( 'Close mobile menu', 'neumorphic' ); ?>"><i class="fas fa-times"></i></button>
<?php
// Drawer menu
wp_nav_menu(
array(
'theme_location' => 'mobile',
'menu_class' => 'drawer__list',
'container' => false,
'walker' => new Neumorphic_Drawer_Walker(),
)
);
// Display mobile search window
if ( true === get_theme_mod( 'mobile_search_display' ) ) :
?>
<div class="drawer__search">
<?php get_search_form(); ?>
</div>
<?php endif; ?>
</div>
</nav>
<?php endif; ?>
<div class="<?php echo esc_attr( neumorphic_contents_class() ); ?>" role="document">
<div class="container">
<div class="contents__inner">