forked from themegrill/spacious
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
183 lines (162 loc) · 6.96 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
172
173
174
175
176
177
178
179
180
181
182
183
<?php
/**
* Theme Header Section for our theme.
*
* Displays all of the <head> section and everything up till <div id="main" class="clearfix"> <div class="inner-wrap">
*
* @package ThemeGrill
* @subpackage Spacious
* @since Spacious 1.0
*/
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) & !(IE 8)]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Add keywords to all pages -->
<meta name="keywords" content="kyle, getz, portfolio, resume, photo, video, blog, travel, software, developer, web, coding, programming, photography, photographer, writing, international" />
<!-- Add other meta tags -->
<?php if (spacious_header_title() == 'Portfolio') { ?>
<meta name="description" content="My portfolio, photo albums, and blog." />
<meta property="og:title" content="Kyle Getz - Coder, Photographer, Traveler, Blogger" />
<?php } elseif(spacious_header_title() == 'Photography') { ?>
<meta name="description" content="Gallery of all my work as a recreational photographer." />
<?php } elseif(spacious_header_title() == 'Blog') { ?>
<meta name="description" content="My blog about travel, photography, and tech." />
<?php } ?>
<!-- Add the featured image as a meta tag -->
<?php if (has_post_thumbnail()) { ?>
<meta property="og:image" content="<?php the_post_thumbnail_url(); ?>" />
<?php } ?>
<!-- Add third-party imports -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Lora&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono&display=swap" rel="stylesheet">
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
/**
* This hook is important for wordpress plugins and other many things
*/
wp_head();
?>
</head>
<body <?php body_class(); ?>>
<?php do_action( 'before' ); ?>
<div id="page" class="hfeed site">
<?php do_action( 'spacious_before_header' ); ?>
<header id="masthead" class="site-header clearfix">
<?php if( spacious_options( 'spacious_header_image_position', 'above' ) == 'above' ) { spacious_render_header_image(); } ?>
<div id="header-text-nav-container">
<div class="inner-wrap">
<div id="header-text-nav-wrap" class="clearfix">
<div id="header-left-section">
<?php
if( ( spacious_options( 'spacious_show_header_logo_text', 'text_only' ) == 'both' || spacious_options( 'spacious_show_header_logo_text', 'text_only' ) == 'logo_only' ) ) {
?>
<div id="header-logo-image">
<?php if ( spacious_options('spacious_header_logo_image', '') != '') { ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo spacious_options( 'spacious_header_logo_image', '' ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"></a>
<?php } ?>
<?php if (function_exists('the_custom_logo') && has_custom_logo( $blog_id = 0 )) {
spacious_the_custom_logo();
} ?>
</div><!-- #header-logo-image -->
<?php
}
$screen_reader = '';
if ( ( spacious_options( 'spacious_show_header_logo_text', 'text_only' ) == 'logo_only' || spacious_options( 'spacious_show_header_logo_text', 'text_only' ) == 'none' ) ) {
$screen_reader = 'screen-reader-text';
}
?>
<div id="header-text" class="<?php echo $screen_reader; ?>">
<?php if ( is_front_page() || is_home() ) : ?>
<h1 id="site-title">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
</h1>
<?php else : ?>
<h3 id="site-title">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
</h3>
<?php endif; ?>
<?php
$description = get_bloginfo( 'description', 'display' );
if ( $description || is_customize_preview() ) : ?>
<p id="site-description"><?php echo $description; ?></p>
<?php endif; ?><!-- #site-description -->
</div><!-- #header-text -->
</div><!-- #header-left-section -->
<div id="header-right-section">
<?php
if( is_active_sidebar( 'spacious_header_sidebar' ) ) {
?>
<div id="header-right-sidebar" class="clearfix">
<?php
// Calling the header sidebar if it exists.
if ( !dynamic_sidebar( 'spacious_header_sidebar' ) ):
endif;
?>
</div>
<?php
}
?>
<nav id="site-navigation" class="main-navigation" role="navigation">
<h3 class="menu-toggle"><?php _e( 'Menu', 'spacious' ); ?></h3>
<?php
if ( has_nav_menu( 'primary' ) ) {
wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'menu-primary-container' ) );
}
else {
wp_page_menu();
}
?>
</nav>
</div><!-- #header-right-section -->
</div><!-- #header-text-nav-wrap -->
</div><!-- .inner-wrap -->
</div><!-- #header-text-nav-container -->
<?php if( spacious_options( 'spacious_header_image_position', 'above' ) == 'below' ) { spacious_render_header_image(); } ?>
<?php
if( spacious_options( 'spacious_activate_slider', '0' ) == '1' ) {
if( spacious_options( 'spacious_blog_slider', '0' ) != '1' ) {
if( is_home() || is_front_page() ) {
spacious_featured_image_slider();
}
} else {
if( is_front_page() ) {
spacious_featured_image_slider();
}
}
}
?>
<div class="header-post-title-container clearfix">
<div class="inner-wrap">
<div class="post-title-wrapper">
<?php
if( '' != spacious_header_title() ) {
?>
<?php if ( is_home() ) : ?>
<h2 class="header-post-title-class"><?php echo spacious_header_title(); ?></h2>
<?php else : ?>
<h1 class="header-post-title-class"><?php echo spacious_header_title(); ?></h1>
<?php endif; ?>
<?php
}
?>
</div>
<?php if( function_exists( 'spacious_breadcrumb' ) ) { spacious_breadcrumb(); } ?>
</div>
</div>
</header>
<?php do_action( 'spacious_after_header' ); ?>
<?php do_action( 'spacious_before_main' ); ?>
<div id="main" class="clearfix">
<div class="inner-wrap">