-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathheader.php
198 lines (147 loc) · 9.2 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
184
185
186
187
188
189
190
191
192
193
194
195
196
<!doctype html>
<head <?php language_attributes(); ?>>
<!-- Meta Tags -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php $options = get_option('salient'); ?>
<?php if(!empty($options['responsive']) && $options['responsive'] == 1) { ?>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=0" />
<meta name="viewport" content="width=device-width" />
<?php } else { ?>
<meta name="viewport" content="width=1200" />
<?php } ?>
<!--Shortcut icon-->
<?php if(!empty($options['favicon'])) { ?>
<link rel="shortcut icon" href="<?php echo $options['favicon']?>" />
<?php } ?>
<title><?php if (!defined('WPSEO_VERSION')) { bloginfo('name'); } ?> <?php wp_title("|",true); ?></title>
<?php wp_head(); ?>
</head>
<?php
global $post;
global $woocommerce;
if($woocommerce && is_shop() || $woocommerce && is_product_category() || $woocommerce && is_product_tag()) {
$header_title = get_post_meta(woocommerce_get_page_id('shop'), '_nectar_header_title', true);
$header_bg = get_post_meta(woocommerce_get_page_id('shop'), '_nectar_header_bg', true);
}
else if(is_home() || is_archive()){
$header_title = get_post_meta(get_option('page_for_posts'), '_nectar_header_title', true);
$header_bg = get_post_meta(get_option('page_for_posts'), '_nectar_header_bg', true);
} else {
$header_title = get_post_meta($post->ID, '_nectar_header_title', true);
$header_bg = get_post_meta($post->ID, '_nectar_header_bg', true);
}
//check if parallax nectar slider is being used
$parallax_nectar_slider = (stripos( $post->post_content, '[nectar_slider') !== FALSE && stripos( $post->post_content, '[nectar_slider') === 0 ) ? '1' : null;
?>
<body <?php body_class(); ?> data-bg-header="<?php echo (!empty($header_bg) || !empty($header_title) || $parallax_nectar_slider == '1') ? 'true' : 'false'; ?>" data-header-color="<?php echo (!empty($options['header-color'])) ? $options['header-color'] : 'light' ; ?>" data-smooth-scrolling="<?php echo $options['smooth-scrolling']; ?>" data-responsive="<?php echo (!empty($options['responsive']) && $options['responsive'] == 1) ? '1' : '0' ?>" >
<?php if(!empty($options['boxed_layout']) && $options['boxed_layout'] == '1') { echo '<div id="boxed">'; } ?>
<?php $using_secondary = (!empty($options['header_layout'])) ? $options['header_layout'] : ' ';
if($using_secondary == 'header_with_secondary') { ?>
<div id="header-secondary-outer">
<div class="container">
<nav>
<?php if(!empty($options['enable_social_in_header']) && $options['enable_social_in_header'] == '1') { ?>
<ul id="social">
<?php if(!empty($options['use-twitter-icon-header']) && $options['use-twitter-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['twitter-url']; ?>"><i class="icon-twitter"></i> </a></li> <?php } ?>
<?php if(!empty($options['use-facebook-icon-header']) && $options['use-facebook-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['facebook-url']; ?>"><i class="icon-facebook"></i> </a></li> <?php } ?>
<?php if(!empty($options['use-vimeo-icon-header']) && $options['use-vimeo-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['vimeo-url']; ?>" class="vimeo">vimeo </a></li> <?php } ?>
<?php if(!empty($options['use-pinterest-icon-header']) && $options['use-pinterest-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['pinterest-url']; ?>"><i class="icon-pinterest"></i> </a></li> <?php } ?>
<?php if(!empty($options['use-linkedin-icon-header']) && $options['use-linkedin-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['linkedin-url']; ?>"><i class="icon-linkedin"></i> </a></li> <?php } ?>
<?php if(!empty($options['use-youtube-icon-header']) && $options['use-youtube-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['youtube-url']; ?>"><i class="icon-youtube"></i> </a></li> <?php } ?>
<?php if(!empty($options['use-tumblr-icon-header']) && $options['use-tumblr-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['tumblr-url']; ?>"><i class="icon-tumblr"></i> </a></li> <?php } ?>
<?php if(!empty($options['use-dribbble-icon-header']) && $options['use-dribbble-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['dribbble-url']; ?>"><i class="icon-dribbble"></i> </a></li> <?php } ?>
<?php if(!empty($options['use-rss-icon-header']) && $options['use-rss-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo (!empty($options['rss-url'])) ? $options['rss-url'] : get_bloginfo('rss_url'); ?>"><i class="icon-rss"></i> </a></li> <?php } ?>
<?php if(!empty($options['use-github-icon-header']) && $options['use-github-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['github-url']; ?>"><i class="icon-github-alt"></i></a></li> <?php } ?>
<?php if(!empty($options['use-behance-icon-header']) && $options['use-behance-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['behance-url']; ?>" class="behance">behance </a></li> <?php } ?>
<?php if(!empty($options['use-google-plus-icon-header']) && $options['use-google-plus-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['google-plus-url']; ?>"><i class="icon-google-plus"></i> </a></li> <?php } ?>
<?php if(!empty($options['use-instagram-icon-header']) && $options['use-instagram-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['instagram-url']; ?>"><i class="icon-instagram"></i></a></li> <?php } ?>
<?php if(!empty($options['use-stackexchange-icon-header']) && $options['use-stackexchange-icon-header'] == 1) { ?> <li><a target="_blank" href="<?php echo $options['stackexchange-url']; ?>"><i class="icon-stackexchange"></i></a></li> <?php } ?>
</ul>
<?php } ?>
<ul class="sf-menu">
<?php
if(has_nav_menu('secondary_nav')) {
wp_nav_menu( array('theme_location' => 'secondary_nav', 'container' => '', 'items_wrap' => '%3$s' ) );
}
else {
echo '<li><a href="">No menu assigned!</a></li>';
}
?>
</ul>
</nav>
</div>
</div>
<?php } ?>
<div id="header-space"></div>
<div id="header-outer" data-using-secondary="<?php echo ($using_secondary == 'header_with_secondary') ? '1' : '0'; ?>" data-using-logo="<?php if(!empty($options['use-logo'])) echo $options['use-logo']; ?>" data-logo-height="<?php if(!empty($options['logo-height'])) echo $options['logo-height']; ?>" data-padding="<?php echo (!empty($options['header-padding'])) ? $options['header-padding'] : "28"; ?>" data-header-resize="<?php if(!empty($options['header-resize-on-scroll'])) echo $options['header-resize-on-scroll']; ?>">
<?php get_search_form(); ?>
<header id="top">
<div class="container">
<div class="row">
<div class="col span_3">
<a id="logo" href="<?php echo home_url(); ?>">
<?php echo (!empty($options['use-logo'])) ? '<img alt="'. get_bloginfo('name') .'" src="' . $options['logo'] . '" />' : get_bloginfo('name'); ?>
</a>
</div><!--/span_3-->
<div class="col span_9 col_last">
<a href="#" id="toggle-nav"><i class="icon-reorder"></i></a>
<nav>
<ul class="sf-menu">
<?php
if(has_nav_menu('top_nav')) {
wp_nav_menu( array('walker' => new Arrow_Walker_Nav_Menu, 'theme_location' => 'top_nav', 'container' => '', 'items_wrap' => '%3$s' ) );
}
else {
echo '<li><a href="">No menu assigned!</a></li>';
}
?>
<li id="search-btn"><div><a href=""><span class="icon-salient-search" aria-hidden="true"></span></a></div></li>
</ul>
</nav>
</div><!--/span_9-->
</div><!--/row-->
</div><!--/container-->
</header>
<?php if (!empty($options['enable-cart']) && $options['enable-cart'] == '1') { ?>
<?php
if ($woocommerce) { ?>
<div class="cart-outer">
<div class="cart-menu-wrap">
<div class="cart-menu">
<a class="cart-contents" href="<?php echo wp_get_cart_url(); ?>"><div class="cart-icon-wrap"><i class="icon-shopping-cart"></i> <div class="cart-wrap"><span><?php echo $woocommerce->cart->cart_contents_count; ?> </span></div> </div></a>
</div>
</div>
<div class="cart-notification">
<span class="item-name"></span> <?php echo __('was successfully added to your cart.'); ?>
</div>
<?php
// Check for WooCommerce 2.0 and display the cart widget
if ( version_compare( WOOCOMMERCE_VERSION, "2.0.0" ) >= 0 ) {
the_widget( 'WC_Widget_Cart', 'title= ' );
} else {
the_widget( 'WooCommerce_Widget_Cart', 'title= ' );
}
?>
</div>
<?php }
} ?>
</div><!--/header-outer-->
<div id="mobile-menu">
<div class="container">
<ul>
<?php
if(has_nav_menu('top_nav')) {
wp_nav_menu( array('theme_location' => 'top_nav', 'menu' => 'Top Navigation Menu', 'container' => '', 'items_wrap' => '%3$s' ) );
echo '<li id="mobile-search">
<form action="'.home_url().'" method="GET">
<input type="text" name="s" value="" placeholder="'.__('Search..', NECTAR_THEME_NAME) .'" />
</form>
</li>';
}
else {
echo '<li><a href="">No menu assigned!</a></li>';
}
?>
</ul>
</div>
</div>