-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
executable file
·166 lines (130 loc) · 10.9 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
<!doctype html>
<?php
$bgimg = '';
if(is_page_template('page-home') || is_page_template('page-home-v2') || is_page_template('page-home-v3')) {
$bgimg = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full', false )[0];
}
?>
<!--[if lt IE 7]><html <?php language_attributes(); ?> class="no-js lt-ie9 lt-ie8 lt-ie7"><![endif]-->
<!--[if (IE 7)&!(IEMobile)]><html <?php language_attributes(); ?> class="no-js lt-ie9 lt-ie8"><![endif]-->
<!--[if (IE 8)&!(IEMobile)]><html <?php language_attributes(); ?> class="no-js lt-ie9"><![endif]-->
<!--[if gt IE 8]><!--> <html <?php language_attributes(); ?> class="no-js"><!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?php wp_title(''); ?></title>
<?php // this is necessary to prevent the viewport height blocks from getting silly ?>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="icon" href="<?php echo get_template_directory_uri(); ?>/favicon.png">
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?> itemscope itemtype="http://schema.org/WebPage">
<?php if (is_page() && !is_page_template('page-squeeze-page.php')) { ?>
<header class="header flex flex-column background-<?php echo do_shortcode(get_post_meta(get_the_ID(), 'header_color', true)); if(is_home()){echo 'green';}; ?> flex-wrap <?php if (is_page_template("page-home.php") || is_page_template("page-home-v2.php") || is_page_template("page-home-v3.php")) { echo "viewport-height-block"; }; ?> <?php if(!empty(get_post_meta(get_the_ID(), 'header_testimonial_person', 1)) && !empty(get_post_meta(get_the_ID(), 'header_testimonial_text', 1))) { ?>no-testimonial<?php }; ?> <?php headerbuttonsexist(); ?>" role="banner" itemscope itemtype="http://schema.org/WPHeader" <?php if(!empty($bgimg)) { echo 'style="background-image:url('.$bgimg.');"'; } ?> >
<div class="sidemenubutton"></div>
<div class="logo fallback contents-center" itemscope itemtype="http://schema.org/Organization"><a href="<?php echo home_url(); ?>" rel="nofollow"><img src="<?php echo get_template_directory_uri(); ?>/library/images/logo-large.png"></a></div>
<nav>
<div class="logo contents-center" itemscope itemtype="http://schema.org/Organization"><a href="<?php echo home_url(); ?>" rel="nofollow"><img src="<?php echo get_template_directory_uri(); ?>/library/images/logo-large.png"></a></div>
<?php if (!is_page_template('page-free-request.php')) { ?>
<?php wp_nav_menu(array(
'container' => false, // remove nav container
'container_class' => 'menu cf', // class of container (should you choose to use it)
'menu' => __( 'The Main Menu', 'bonestheme' ), // nav name
'menu_class' => 'nav top-nav cf', // adding custom nav class
'theme_location' => 'main-nav', // where it's located in the theme
'before' => '', // before the menu
'after' => '', // after the menu
'link_before' => '', // before each link
'link_after' => '', // after each link
'depth' => 0, // limit the depth of the nav
'fallback_cb' => '' // fallback function (if there is one)
)); ?>
<?php } ?>
<a href="<?php get_custom('login_url'); ?>" class="button-black-outline nav-button">Log In</a>
<a href="<?php get_custom('signup_url'); ?>" class="button-green-fill nav-button">Sign Up</a>
<div class="closebutton"></div>
</nav>
<div class="dheader-content flex full-width text-center" style="width:100%;">
<?php if(!empty(get_post_meta(get_the_ID(), 'replace_header_content', 1))) { ?>
<?php echo get_post_meta(get_the_ID(), 'replace_header_content', 1); ?>
<?php } else { ?>
<div class="wide-650">
<h1 class="title"><?php if (empty(get_post_meta(get_the_ID(), 'header_h1', 1))){ echo get_the_title(); } else { echo get_post_meta(get_the_ID(), 'header_h1', 1); } ?></h1>
<?php if(!empty(get_post_meta(get_the_ID(), 'header_subhead', 1))) { ?>
<p class="subhead"><?php echo get_post_meta(get_the_ID(), 'header_subhead', 1); ?></p>
<?php } ?>
<?php if(!empty(get_post_meta(get_the_ID(), 'header_subhead_extra', 1))) { ?>
<p class="subhead-alt"><?php echo get_post_meta(get_the_ID(), 'header_subhead_extra', 1); ?></p>
<?php } ?>
<?php if( (!empty(get_post_meta(get_the_ID(), 'header_primary_button_text', 1)) && (!empty(get_post_meta(get_the_ID(), 'header_primary_button_url', 1)))) || (!empty(get_post_meta(get_the_ID(), 'header_secondary_button_text', 1)) && (!empty(get_post_meta(get_the_ID(), 'header_secondary_button_url', 1)))) || (!empty(get_post_meta(get_the_ID(), 'header_first_custom_button'))) || (!empty(get_post_meta(get_the_ID(), 'header_last_custom_button')))) { ?>
<div class="button-wrap">
<?php } ?>
<?php echo get_post_meta(get_the_ID(), 'header_first_custom_button', 1); ?>
<?php if(!empty(get_post_meta(get_the_ID(), 'header_primary_button_text', 1)) && (!empty(get_post_meta(get_the_ID(), 'header_primary_button_url', 1)))) { ?>
<a class="button-green-fill" href="<?php echo get_post_meta(get_the_ID(), 'header_primary_button_url', 1); ?>"><?php echo get_post_meta(get_the_ID(), 'header_primary_button_text', 1); ?></a>
<?php } ?>
<?php if(!empty(get_post_meta(get_the_ID(), 'header_secondary_button_text', 1)) && (!empty(get_post_meta(get_the_ID(), 'header_secondary_button_url', 1)))) { ?>
<a class="button-green-fill" href="<?php echo get_post_meta(get_the_ID(), 'header_secondary_button_url', 1); ?>"><?php echo get_post_meta(get_the_ID(), 'header_secondary_button_text', 1); ?></a>
<?php } ?>
<?php echo get_post_meta(get_the_ID(), 'header_last_custom_button', 1); ?>
<?php if( (!empty(get_post_meta(get_the_ID(), 'header_primary_button_text', 1)) && (!empty(get_post_meta(get_the_ID(), 'header_primary_button_url', 1)))) || (!empty(get_post_meta(get_the_ID(), 'header_secondary_button_text', 1)) && (!empty(get_post_meta(get_the_ID(), 'header_secondary_button_url', 1)))) ) { ?>
</div>
<?php } ?>
<?php if(!empty(get_post_meta(get_the_ID(), 'header_button_support', 1))) { ?>
<p class="button-support text-center">7 Day Money-Back Guarantee</p>
<?php } ?>
</div>
<?php } ?>
</div>
<?php if(!empty(get_post_meta(get_the_ID(), 'header_testimonial_person', 1)) && !empty(get_post_meta(get_the_ID(), 'header_testimonial_text', 1))) { ?>
<div class="testimonial header-testimonial">
<div class="content flex">
<img src="http://placehold.it/100x100">
<blockquote class="testimonial-content flex">
<cite><?php echo get_post_meta(get_the_ID(), 'header_testimonial_person', 1); ?></cite>
<p><?php echo get_post_meta(get_the_ID(), 'header_testimonial_text', 1); ?></p>
</blockquote>
</div>
</div>
<?php } ?>
</header>
<?php } else if (!is_page_template('page-squeeze-page.php')) { ?>
<header class="header flex flex-column background-green flex-wrap <?php if (is_page_template("page-home.php") || is_page_template("page-home-v2.php") || is_page_template("page-home-v3.php")) { echo "viewport-height-block"; }; ?> <?php if(!empty(get_post_meta(get_the_ID(), 'header_testimonial_person', 1)) && !empty(get_post_meta(get_the_ID(), 'header_testimonial_text', 1))) { ?>no-testimonial<?php }; ?> <?php headerbuttonsexist(); ?>" role="banner" itemscope itemtype="http://schema.org/WPHeader">
<div class="sidemenubutton"></div>
<div class="logo fallback contents-center" itemscope itemtype="http://schema.org/Organization"><a href="<?php echo home_url(); ?>" rel="nofollow"><img src="<?php echo get_template_directory_uri(); ?>/library/images/logo-large.png"></a></div>
<nav>
<div class="logo contents-center" itemscope itemtype="http://schema.org/Organization"><a href="<?php echo home_url(); ?>" rel="nofollow"><img src="<?php echo get_template_directory_uri(); ?>/library/images/logo-small.png"></a></div>
<?php wp_nav_menu(array(
'container' => false, // remove nav container
'container_class' => 'menu cf', // class of container (should you choose to use it)
'menu' => __( 'The Main Menu', 'bonestheme' ), // nav name
'menu_class' => 'nav top-nav cf', // adding custom nav class
'theme_location' => 'main-nav', // where it's located in the theme
'before' => '', // before the menu
'after' => '', // after the menu
'link_before' => '', // before each link
'link_after' => '', // after each link
'depth' => 0, // limit the depth of the nav
'fallback_cb' => '' // fallback function (if there is one)
)); ?>
<a href="<?php get_custom('login_url'); ?>" class="button-black-outline nav-button">Log In</a>
<a href="<?php get_custom('signup_url'); ?>" class="button-green-fill nav-button">Sign Up</a>
<div class="closebutton"></div>
</nav>
<div class="dheader-content flex full-width text-center" style="width:100%;">
<div class="wide-650">
<h1 class="title"><?php get_custom('blog_title'); ?></h1>
<p class="subhead"><?php get_custom('blog_subtitle'); ?></p>
</div>
</div>
</header>
<?php } else { ?>
<header class="header flex flex-column background-green flex-wrap <?php if (is_page_template("page-home.php") || is_page_template("page-home-v2.php") || is_page_template("page-home-v3.php")) { echo "viewport-height-block"; }; ?> <?php if(!empty(get_post_meta(get_the_ID(), 'header_testimonial_person', 1)) && !empty(get_post_meta(get_the_ID(), 'header_testimonial_text', 1))) { ?>no-testimonial<?php }; ?> <?php headerbuttonsexist(); ?>" role="banner" itemscope itemtype="http://schema.org/WPHeader">
<div class="sidemenubutton"></div>
<div class="logo fallback contents-center" itemscope itemtype="http://schema.org/Organization"><img src="<?php echo get_template_directory_uri(); ?>/library/images/logo-large.png"></div>
<nav>
<div class="logo contents-center" itemscope itemtype="http://schema.org/Organization"><img src="<?php echo get_template_directory_uri(); ?>/library/images/logo-large.png"></div>
</nav>
</header>
<?php } ?>