-
Notifications
You must be signed in to change notification settings - Fork 2
/
header.php
158 lines (98 loc) · 3.8 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
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0" >
<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();
}
?>
<a class="skip-link button" href="#site-content"><?php esc_html_e( 'Skip to the content', 'wilson' ); ?></a>
<div class="wrapper">
<header class="sidebar" id="site-header">
<div class="blog-header">
<?php
$custom_logo_id = get_theme_mod( 'custom_logo' );
$legacy_logo_url = get_theme_mod( 'wilson_logo' );
$blog_title = get_bloginfo( 'title' );
$blog_description = get_bloginfo( 'description' );
$blog_title_elem = ( ( is_front_page() || is_home() ) && ! is_page() ) ? 'h1' : 'div';
if ( $custom_logo_id || $legacy_logo_url ) :
$custom_logo_url = $custom_logo_id ? wp_get_attachment_image_url( $custom_logo_id, 'full' ) : $legacy_logo_url;
?>
<<?php echo $blog_title_elem; ?> class="blog-logo">
<a href="<?php echo esc_url( home_url( "/" ) ); ?>" rel="home">
<img src="<?php echo esc_url( $custom_logo_url ); ?>">
<?php if ( $blog_title ) : ?>
<span class="screen-reader-text"><?php echo $blog_title; ?></span>
<?php endif; ?>
</a>
</<?php echo $blog_title_elem; ?>><!-- .blog-logo -->
<?php elseif ( $blog_title || $blog_description ) : ?>
<div class="blog-info">
<?php if ( $blog_title ) : ?>
<<?php echo $blog_title_elem; ?> class="blog-title">
<a href="<?php echo esc_url( home_url() ); ?>" rel="home"><?php echo $blog_title; ?></a>
</<?php echo $blog_title_elem; ?>>
<?php endif; ?>
<?php if ( $blog_description ) : ?>
<p class="blog-description"><?php echo $blog_description; ?></p>
<?php endif; ?>
</div><!-- .blog-info -->
<?php endif; ?>
</div><!-- .blog-header -->
<div class="nav-toggle toggle">
<p>
<span class="show"><?php _e( 'Show menu', 'wilson' ); ?></span>
<span class="hide"><?php _e( 'Hide menu', 'wilson' ); ?></span>
</p>
<div class="bars">
<div class="bar"></div>
<div class="bar"></div>
<div class="bar"></div>
<div class="clear"></div>
</div><!-- .bars -->
</div><!-- .nav-toggle -->
<div class="blog-menu">
<ul class="navigation">
<?php
if ( has_nav_menu( 'primary' ) ) {
$menu_args = array(
'container' => '',
'items_wrap' => '%3$s',
'theme_location' => 'primary',
);
wp_nav_menu( $menu_args );
} else {
$list_pages_args = array(
'container' => '',
'title_li' => ''
);
wp_list_pages( $list_pages_args );
}
?>
</ul><!-- .navigation -->
</div><!-- .blog-menu -->
<div class="mobile-menu">
<ul class="navigation">
<?php
if ( has_nav_menu( 'primary' ) ) {
wp_nav_menu( $menu_args );
} else {
wp_list_pages( $list_pages_args );
}
?>
</ul>
</div><!-- .mobile-menu -->
<?php if ( is_active_sidebar( 'sidebar' ) ) : ?>
<div class="widgets" role="complementary">
<?php dynamic_sidebar( 'sidebar' ); ?>
</div><!-- .widgets -->
<?php endif; ?>
</header><!-- .sidebar -->
<main class="content" id="site-content">