-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathheader.php
More file actions
149 lines (128 loc) · 5.61 KB
/
header.php
File metadata and controls
149 lines (128 loc) · 5.61 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Basic Page Needs
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta charset="utf-8">
<title><?php wp_title('|',true,'right'); ?></title>
<meta name="description" content="<?php bloginfo('description'); ?>">
<meta name="author" content="Ben Mayersohn">
<?php
require_once('default_theme_vals.php');
// Add transparency to arrow background color
$hex = get_theme_mod('essentials_scrollup_bg',SCROLLUP_BG_COLOR);
list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x");
$arrow_bg = "rgba($r, $g, $b, " . SCROLLUP_BG_OPACITY . ")";
?>
<!-- Mobile Specific Metas
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- FONT
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css">
<!-- These style values are set in WordPress customizer -->
<?php
echo "<style>
#main-menu>.nav>li>a:focus, #main-menu>.nav>li>a:hover {
background-color: " . get_theme_mod('essentials_navbar_bg',NAVBAR_BG_DEFAULT) . ";
color: " . get_theme_mod('essentials_navbar_text_active',NAVBAR_TEXT_ACTIVE) . ";
}
#main-menu>.nav>.active>a{
background-color: " . get_theme_mod('essentials_body_bg',BODY_BACKGROUND) . ";
}
#main-menu{
background-color: " . get_theme_mod('essentials_body_bg',BODY_BACKGROUND) . ";
}
#main-menu>ul>li>a{
color: " . get_theme_mod('essentials_navbar_text',NAVBAR_TEXT) . ";
}
#dropdown-button{
border-color: " . get_theme_mod('essentials_navbar_mobile_color',NAVBAR_MOBILE_DEFAULT) . ";
background-color: " . get_theme_mod('essentials_body_bg',BODY_BACKGROUND) . ";
}
.scroll-up-button{
background-color: " . $arrow_bg . ";
color: " . get_theme_mod('essentials_scrollup_color',SCROLLUP_ARROW_COLOR) . ";
}
a.scroll-up-button:visited,a.scroll-up-button:hover{
color: " . get_theme_mod('essentials_scrollup_color',SCROLLUP_ARROW_COLOR) . ";
}
";
$featured_img_url = get_the_post_thumbnail_url(get_the_ID(), 'large');
if ( $featured_img_url && !(get_post_type(get_the_ID()) === 'post') ) {
echo ".pre-nav{
background-color: transparent;
background-image: url('" . $featured_img_url . "');}";
}
else{
$header_bg_id = get_theme_mod('essentials_body_header_bg_img');
$header_bg_url = wp_get_attachment_image_src($header_bg_id, 'large')[0];
if (get_theme_mod('essentials_body_header_bg_img') != ''){
echo ".pre-nav{
background-color: transparent;
background-image: url('" . $header_bg_url . "');}";
}
elseif (get_theme_mod('essentials_body_header_bg_color') != ''){
echo ".pre-nav{
background-color: " . get_theme_mod('essentials_body_header_bg_color',BODY_BACKGROUND) . ";}";
}
}
echo "</style>";
?>
<?php wp_head();
// Get header image attachment ID and set using thumbnail
$header_img = get_theme_mod('header_image_data');
$header_img = is_object($header_img) ? get_object_vars($header_img) : $header_img;
$header_img_id = $header_img['attachment_id'];
$header_img_url = wp_get_attachment_image_src($header_img_id, 'large')[0];
?>
</head>
<body data-spy="scroll" style=
"<?php echo "background-color: " . get_theme_mod('essentials_body_bg',BODY_BACKGROUND);?>;
color:<?php echo get_theme_mod('essentials_body_text_color',BODY_TEXT_COLOR);?>;">
<!-- Primary Page Layout
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<section class="header">
<div class="pre-nav">
<a href="<?php echo get_site_url(); ?>">
<img id="title-img" class="img-responsive" alt="" src="<?php echo $header_img_url; ?>">
</a>
<h1 class="main-subtitle" style="background-color:<?php echo get_theme_mod('essentials_subtitle_bg',SUBTITLE_BG_DEFAULT); ?>"><?php echo get_theme_mod('essentials_subtitle_text',SUBTITLE_TEXT_DEFAULT); ?></h1>
</div>
<div class="navbar-before"></div>
<a class="scroll-up-button">
<i class="fa fa-arrow-up fa-lg" aria-hidden="true"></i>
</a>
<div id="dropdown-button" class="navbar-header">
<a class="navbar-toggle collapsed btn btn-navbar" style="color:<?php echo get_theme_mod('essentials_navbar_mobile_color',NAVBAR_MOBILE_DEFAULT);?>;" data-toggle="collapse" data-target="#main-menu">
<span class="glyphicon glyphicon-menu-hamburger"></span>
</a>
<div class="mobile-indicator"></div>
</div>
<?php
wp_nav_menu( array(
'menu' => 'primary',
'theme_location' => 'primary',
'container' => 'div',
'container_class' => 'navbar-inner navbar-collapse collapse',
'container_id' => 'main-menu',
'menu_class' => 'nav nav-pills nav-justified',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker())
);
?>
</section>
<hr class="non-mobile-separator">
<div class="container">
<?php
if ( function_exists('yoast_breadcrumb') ) {
$options = get_option( 'wpseo_internallinks' );
if ( !($options['breadcrumbs-enable'] === false || is_front_page()) ) {
yoast_breadcrumb('
<p id="breadcrumbs">','</p>
');
echo "<hr class=\"breadcrumbs-hr\">";
}
}
?>
<?php get_sidebar('header');?>