-
Notifications
You must be signed in to change notification settings - Fork 1
/
header.php
130 lines (120 loc) · 3.73 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
<?php
/**
* The Header for our theme
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Nickel
* @since Nickel 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">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>
<?php
global $nickel_site_width, $nickel_layout_type, $withcomments;
$withcomments = 1;
$form_class = '';
$class = '';
$nickel_site_width = 'col-sm-12 col-md-12 col-lg-12';
$layout_type = get_post_meta(get_the_id(), 'layouts', true);
if ( !isset($search_string) ) {
$search_string = '';
}
if ( is_archive() || is_search() || is_404() ) {
$layout_type = 'full';
} elseif (empty($layout_type)) {
$layout_type = get_theme_mod('nickel_layout', 'full');
}
$header_display = get_theme_mod('nickel_header_presentation', 'text');
switch ($layout_type) {
case 'right':
define('NICKEL_LAYOUT', 'sidebar-right');
break;
case 'full':
define('NICKEL_LAYOUT', 'sidebar-no');
break;
case 'left':
define('NICKEL_LAYOUT', 'sidebar-left');
break;
}
if ( ( NICKEL_LAYOUT != 'sidebar-no' && is_active_sidebar( 'sidebar-5' ) ) || ( NICKEL_LAYOUT != 'sidebar-no' && is_active_sidebar( 'sidebar-6' ) ) ) {
$nickel_site_width = 'col-sm-9 col-md-9 col-lg-9';
}
$logo = get_theme_mod('nickel_header_logo', '');
if (get_search_query() == '') {
$search_string = esc_html__('Search', 'nickel');
} else {
$search_string = get_search_query();
}
$title_color_style = '';
$title_color = get_theme_mod('header_textcolor', false);
if ( $title_color ) {
$title_color_style = 'style="color: #'.$title_color.'"';
}
?>
<body <?php body_class(); ?>>
<?php do_action('ase_theme_body_inside_top'); ?>
<div id="page" class="hfeed site">
<header class="main-header">
<div class="header-wrapper">
<div class="logo-wrapper">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="header-logo">
<?php if ( $header_display == 'logo' && $logo != '' ) { ?>
<img src="<?php echo esc_url($logo); ?>" alt="<?php esc_html_e('Site logo', 'nickel'); ?>">
<?php } else { ?>
<span class="blog-name" <?php echo $title_color_style; ?>><?php bloginfo( 'name' ); ?></span>
<span class="blog-description"><?php bloginfo( 'description' ); ?></span>
<?php } ?>
</a>
</div>
<nav id="primary-navigation" class="primary-navigation" role="navigation">
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'menu_class' => 'nav-menu',
'depth' => 4,
'walker' => new Nickel_Header_Menu_Walker
)
);
?>
</nav>
<nav id="mobile-navigation" class="mobile-navigation" role="navigation">
<?php
wp_nav_menu(
array(
'theme_location' => 'primary',
'menu_class' => 'nav-mobile-menu',
'depth' => 4,
'walker' => new Nickel_Header_Menu_Walker
)
);
?>
</nav>
<div class="bottom-header">
<div class="header-search-container">
<span class="header-search icon-search"></span>
<?php get_search_form( true ); ?>
</div>
<?php if ( function_exists('nickel_get_social_icons') ) { nickel_get_social_icons(); } ?>
<a href="javascript:void(0)" class="mobile-menu-button icon-menu"></a>
</div>
<div class="clearfix"></div>
</div>
</header>
<div id="main" class="site-main container">