This repository has been archived by the owner on Apr 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
179 lines (163 loc) · 6.04 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
<?php $wordstrap_options = get_option( 'theme_wordstrap_options' ); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title><?php wp_title('|', true, 'right'); bloginfo('blog_title'); ?></title>
<!-- HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/lib/bootstrap/css/bootstrap.css">
<?php if($wordstrap_options['responsive']): ?>
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/lib/bootstrap/css/responsive.css">
<?php endif; ?>
<link rel="stylesheet/less" href="<?php bloginfo('template_directory'); ?>/less/style.less">
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>">
<?php if( ( is_single() || is_page() ) && has_post_thumbnail() ): ?>
<?php
$thumbnail = array(
"xlarge" => wp_get_attachment_image_src( get_post_thumbnail_id(), array(1170, 9999)),
"large" => wp_get_attachment_image_src( get_post_thumbnail_id(), array(852, 9999)),
"medium" => wp_get_attachment_image_src( get_post_thumbnail_id(), array(724, 9999)),
"small" => wp_get_attachment_image_src( get_post_thumbnail_id(), array(440, 9999)),
"normal" => wp_get_attachment_image_src( get_post_thumbnail_id(), array(852, 9999)),
);
$header_colour = get_post_meta($post->ID, "wordstrap_hero_area_colour", true);
?>
<style>
.wordstrap-featured-image {
background-image: url(<?php echo $thumbnail['normal'][0]; ?>);
}
<?php if($header_colour) : ?>
.hero-unit, .hero-unit h1, .hero-unit p {
color: <?php echo $header_colour; ?>;
}
<?php endif; ?>
<?php if($wordstrap_options['responsive']): ?>
@media (max-width: 480px) {
.wordstrap-featured-image {
background-image: url(<?php echo $thumbnail['small'][0]; ?>);
}
}
@media (max-width: 767px) {
.wordstrap-featured-image {
background-image: url(<?php echo $thumbnail['medium'][0]; ?>);
}
}
@media (max-width: 979px) and (min-width: 768px) {
.wordstrap-featured-image {
background-image: url(<?php echo $thumbnail['medium'][0]; ?>);
}
}
@media (min-width: 1200px) {
.wordstrap-featured-image {
background-image: url(<?php echo $thumbnail['xlarge'][0]; ?>);
}
}
<?php endif; ?>
</style>
<?php endif; ?>
<!-- <?php echo $post->ID; ?> -->
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header>
<?php if ( "fixed" === $wordstrap_options['menu']['type']) : ?>
<nav id="primary-menu">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<?php if($wordstrap_options['responsive']): ?>
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<?php endif; ?>
<?php if($wordstrap_options['menu']['branding'] || $wordstrap_options['responsive']): ?>
<a href="<?php bloginfo('url'); ?>" class="brand<?php if(!$wordstrap_options['menu']['branding']) { echo " hidden-desktop"; } ?>"><?php bloginfo('blog_title'); ?></a>
<?php endif; ?>
<?php if($wordstrap_options['responsive']): ?>
<div class="nav-collapse">
<?php endif; ?>
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'container' => false,
'menu_class' => 'nav',
'depth' => $wordstrap_options['menu']['depth']+1,
'walker' => new Wordstrap_Menu_Walker()
)
);
if($wordstrap_options['menu']['search']) {
get_search_form();
}
?>
<?php if($wordstrap_options['responsive']): ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
</nav>
<?php endif; ?>
<div class="container">
<div class="row" id="branding">
<div class="span12">
<?php if(!$wordstrap_options['menu']['branding']): ?>
<hgroup>
<h1 id="site-title"><a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('blog_title'); ?>">
<span><?php bloginfo('blog_title'); ?></span>
</a></h1>
<p id="site-description">
<?php bloginfo('description'); ?>
</p>
</hgroup>
<?php endif; ?>
</div>
</div> <!-- /branding -->
<?php if ( "static" === $wordstrap_options['menu']['type']) : ?>
<nav id="primary-menu">
<div class="navbar navbar-static">
<div class="navbar-inner">
<div class="container" style="width:auto;">
<?php if($wordstrap_options['responsive']): ?>
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<?php endif; ?>
<?php if( $wordstrap_options['menu']['branding']): ?>
<a href="<?php bloginfo('url'); ?>" class="brand"><?php bloginfo('blog_title'); ?></a>
<?php endif; ?>
<?php if($wordstrap_options['responsive']): ?>
<div class="nav-collapse">
<?php endif; ?>
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'container' => false,
'menu_class' => 'nav',
'walker' => new Wordstrap_Menu_Walker(),
'depth' => $wordstrap_options['menu']['depth']
)
);
if($wordstrap_options['menu']['search']) {
get_search_form();
}
?>
<?php if($wordstrap_options['responsive']): ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
</nav>
<?php endif; ?>
</div> <!-- /.container -->
</header>