-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathheader.php
167 lines (151 loc) · 6.15 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
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package Openstrap
* @subpackage Openstrap
* @since Openstrap 0.1
*/
?><!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.0">
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="bodychild">
<!-- Wrap all page content here -->
<div id="wrap">
<?php
$site_logo = of_get_option('site_logo');
$header = get_header_textcolor();
$header_background = of_get_option('header_background');
//check and get if any header image set from WP Settings
$wp_header_image = get_header_image();
if(empty($header_background) && !empty($wp_header_image)):
$header_background = get_header_image();
endif;
$header_contact_phone = of_get_option('header_contact_phone');
$header_contact_mail = of_get_option('header_contact_mail');
$display_nav_search = of_get_option('display_nav_search');
?>
<?php if ( $header !== "blank" ) : ?>
<header class="site-header" role="banner">
<div id="header-top">
<div class="container hidden-xs">
<div class="pull-left header-contact" id="header-top-container">
<?php if(!empty($header_contact_phone)):?>
<span><i class="icon-phone"></i> <?php echo $header_contact_phone;?></span>
<?php endif;?>
<?php if(!empty($header_contact_mail)):?>
<span><i class="icon-envelope-alt"></i> <a href="mailto:<?php echo $header_contact_mail;?>"><?php echo $header_contact_mail;?></a></span>
<?php endif;?>
</div>
<div class="pull-right" id="header-top-container">
<div class="pull-right">
<div class="pull-left">
<?php
wp_nav_menu( array( 'theme_location' => 'secondary',
'menu_class' => 'list-inline',
'depth' =>1,
'container' => false,
'fallback_cb' => false ) );
?>
</div>
<?php if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) :?>
<div class="woocommerce-header-cart pull-right">
<?php global $woocommerce; ?>
<a href="<?php echo $woocommerce->cart->get_cart_url(); ?>">
<?php if ($woocommerce->cart->cart_contents_count == 0){
printf( '<i class="icon-shopping-cart"></i>', get_stylesheet_directory_uri());
}else{
printf( '<i class="icon-shopping-cart"></i>', get_stylesheet_directory_uri());
}
?>
</a>
<a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" >
Your Cart : <?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'openstrap'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a>
</div>
<?php endif;?>
</div>
</div>
</div>
</div>
<div class="header-body">
<div class="container">
<div class="row logo-row">
<div class="col-md-4 pull-left">
<?php if ( $site_logo != '' ) : ?>
<a href="<?php echo esc_url( home_url( '/' )); ?>"><img src="<?php echo esc_url($site_logo); ?>" alt="<?php bloginfo('description'); ?>" class="img-responsive" /></a>
<?php elseif($site_logo == '' || !isset($site_logo)): ?>
<h1 class="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>
<small><?php bloginfo( 'description' ); ?></small>
<?php endif; ?>
</div>
<div class="col-md-8 hidden-xs">
<div class="pull-right">
<?php if ( is_active_sidebar( 'openstrap_header_right' ) ) : ?>
<?php dynamic_sidebar( 'openstrap_header_right' ); ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</header>
<?php endif; ?>
<!-- Fixed navbar -->
<div class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--
<a class="navbar-brand visible-xs" href="<?php echo esc_url (home_url( '/' )); ?>"><i class="icon-home"></i></a>
-->
<?php if(isset($display_nav_search) && $display_nav_search==true): ?>
<div class="navbar-search-sm pull-right visible-sm visible-xs">
<form class="navbar-search navbar-form" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<input type="search" name="s" id="s" class="search-fields" placeholder="<?php esc_attr_e( 'Search', 'openstrap' ); ?>" name="s">
</form>
</div>
<?php endif; ?>
</div>
<div class="navbar-collapse collapse">
<?php wp_nav_menu( array(
'theme_location' => 'primary',
'menu_class' => 'nav navbar-nav pull-left',
'depth' =>4,
'container' => false,
'fallback_cb' => false,
'walker' => new openstrap_theme_navigation() ) ); ?>
<?php if(isset($display_nav_search) && $display_nav_search==true): ?>
<ul class="nav navbar-nav navbar-right visible-md visible-lg pull-right">
<li>
<form class="navbar-search navbar-form" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<input type="search" name="s" id="s" class="search-fields" placeholder="<?php esc_attr_e( 'Search', 'openstrap' ); ?>" name="s">
</form>
</li>
</ul>
<?php endif; ?>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container" id="main-container">
<div class="row" id="main-row">