/
header.php
361 lines (233 loc) · 11.7 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<!DOCTYPE html>
<!--[if lt IE 8]> <html <?php language_attributes(); ?> class="no-touch no-js ie7 ie <?php echo get_option('rb_ltype'); ?>" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if IE 8]> <html <?php language_attributes(); ?> class="no-touch no-js ie8 ie <?php echo get_option('rb_ltype'); ?>" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if IE 9]> <html <?php language_attributes(); ?> class="no-touch no-js no-ie ie9 <?php echo get_option('rb_ltype'); ?>" xmlns="http://www.w3.org/1999/xhtml"> <![endif]-->
<!--[if gt IE 9]><!--> <html <?php language_attributes(); ?> xmlns="http://www.w3.org/1999/xhtml" class="no-ie no-touch no-js <?php echo get_option('rb_ltype'); ?> csstransforms no-csstransforms3d csstransitions"> <!--<![endif]-->
<head>
<!-- META -->
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="author" content="rubenbristian.com" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- TITLE & SEO -->
<title><?php wp_title( '|', true, 'right' ); ?></title>
<?php
if ( function_exists('wpseo_init') || function_exists('aioseop_load_modules') || function_exists('su_get_user_agent') ) {
$i = 0;
if ( have_posts() ) while ( have_posts() ) : the_post();
if(++$i <= 1) {
echo '<meta name="description" content="' . rb_excerpt('rb_post', 'rb_more') . '">';
}
endwhile;
}
?>
<!-- LINKS -->
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<link rel="shortcut icon" type="image/x-icon" href="<?php echo ot_get_option('rb_favicon', get_template_directory_uri().'/images/favicon.ico')?>" />
<!-- STYLES -->
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<?php
global $responsive;
global $sidebar;
global $retina;
if (isset($_COOKIE['dpi']))
$retina = $_COOKIE['dpi'];
else
$retina = false;
$custom_the_title = '';
wp_deregister_script('comment-reply');
wp_deregister_script('wp-mediaelement');
wp_deregister_style('wp-mediaelement');
/* JM- superfish stuff, for projects page */
if (is_page('2')){
wp_register_style( 'superfish_style', get_stylesheet_directory_uri() . '/superfish/css/superfish.css' );
wp_enqueue_style( 'superfish_style' );
//echo "it's post #2!";
}
if(is_search()){
$sidebar = array(
'sidebar_type' => ot_get_option('rb_search_sidebars'),
'sidebar_id' => 'rb_search_widget_right'
);
$custom_the_title = ot_get_option('rb_search_title', '');
} else {
if ( have_posts() ) while ( have_posts() ) : the_post();
if(function_exists('is_woocommerce') && (is_woocommerce() && !(is_cart() || is_checkout() || is_account_page()))){
$custom_the_title = ot_get_option('rb_shop_title', 'Shop');
if(is_shop() || is_product_category() || is_product_tag()){
$sidebar = array(
'sidebar_type' => ot_get_option('rb_shop_sidebars'),
'sidebar_id' => 'rb_shop_widget_2'
);
}
} else if(is_page_template('template-blog-classic.php') || (is_archive() && !is_post_type_archive('portfolio')) || (is_single() && get_post_type() == 'post')) {
$sidebar = array(
'sidebar_type' => ot_get_option('rb_blog_sidebars'),
'sidebar_id' => 'rb_blog_widget_right'
);
$custom_the_title = ot_get_option('rb_blog_title', '');
} else if(is_page_template('template-portfolio.php')) {
$sidebar = array(
'sidebar_type' => get_post_meta($post->ID, 'rb_meta_box_sidebar_layout', true),
'sidebar_id' => get_post_meta($post->ID, 'rb_meta_box_sidebar_set', true)
);
$custom_the_title = get_the_title($post->ID);
} else if( is_post_type_archive('portfolio')) {
$v_page = isset($_GET['id']) ? $_GET['id'] : ot_get_option('rb_def_p_page', '');
$sidebar = array(
'sidebar_type' => get_post_meta($v_page, 'rb_meta_box_sidebar_layout', true),
'sidebar_id' => get_post_meta($v_page, 'rb_meta_box_sidebar_set', true)
);
$custom_the_title = get_the_title($v_page);
} else if (is_single() && get_post_type() == 'portfolio') {
$v_page = isset($_GET['id']) ? $_GET['id'] : ot_get_option('rb_def_p_page', '');
$sidebar = array(
'sidebar_type' => 'right-sidebar',
'sidebar_id' => '1'
);
$custom_the_title = get_the_title($v_page);
} else {
$sidebar = array(
'sidebar_type' => get_post_meta($post->ID, 'rb_meta_box_sidebar_layout', true),
'sidebar_id' => get_post_meta($post->ID, 'rb_meta_box_sidebar_set', true)
);
}
endwhile;
}
if(is_404()) {
if(ot_get_option('rb_404', '') != '') {
$custom_the_title = get_the_title(ot_get_option('rb_404', ''));
$sidebar = array(
'sidebar_type' => get_post_meta(ot_get_option('rb_404', ''), 'rb_meta_box_sidebar_layout', true),
'sidebar_id' => get_post_meta(ot_get_option('rb_404', ''), 'rb_meta_box_sidebar_set', true)
);
} else {
$custom_the_title = __('404 Error', 'goodwork');
}
}
if(ot_get_option('rb_tracking_where') == 'head') echo ot_get_option('rb_tracking'); ?>
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!-- WP HEAD -->
<?php wp_head(); ?>
</head>
<body id="body" <?php body_class($sidebar); ?>>
<!-- Main Wrapper Start -->
<div class="clearfix wrapper tt<?php echo get_post_meta($post->ID, 'rb_meta_box_t_show', true); ?>">
<!-- Header Start -->
<header id="mainHeader" class=" <?php echo get_option('rb_o_hlayout'); ?> <?php echo get_option('rb_hmenu'); ?> <?php echo get_option('rb_o_hlogo'); ?>">
<div id="headerContainer" class="clearfix wrapper">
<nav id="menu" class="right cart<?php echo ot_get_option('rb_show_cart', 'false'); ?>">
<p class="responsive"><?php _e('Navigation', 'goodwork'); ?></p>
<?php if ( has_nav_menu( 'primary' ) ) {
wp_nav_menu( array(
'container' => false,
'menu_class' => 'clearfix',
'echo' => true,
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'depth' => 3,
'theme_location' => 'primary',
'walker' => new menu_default_walker()
)
);
} ?>
<?php if(get_option('rb_o_hsearch') == 'true')
get_search_form();
if(function_exists('is_woocommerce') && ot_get_option('rb_show_cart') === 'true') :
global $woocommerce; ?>
<div class="cart-widget"><a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><p><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?><?php echo $woocommerce->cart->get_cart_total(); ?></p></a></div>
<?php endif; ?>
</nav>
<!-- Logo Start -->
<div id="logo" class="clearfix test">
<?php
$logo = get_option( 'krown_logo' );
$logo_x2 = get_option( 'krown_logo_x2' );
if ( $logo == '' ) {
$logo = get_template_directory_uri() . '/images/logo.png';
}
if ( $logo_x2 == '' ) {
$logo_x2 = $logo;
}
?>
<a href="<?php echo home_url(); ?>" style="width:<?php echo get_option( 'krown_logo_width', '193' ); ?>px;">
<img class="default" src="<?php echo $logo; ?>" alt="<?php bloginfo( 'name' ); ?>" />
<img class="retina" src="<?php echo $logo_x2; ?>" alt="<?php bloginfo('name'); ?>" />
</a>
</div>
<!-- Logo End -->
<!--
<div id="logo" class="clearfix">
<a href="<?php echo home_url(); ?>" style="width:<?php echo ot_get_option('rb_logo_width_cc', '169'); ?>px">
<img class="default" src="<?php echo ot_get_option('rb_logo', get_template_directory_uri().'/images/logo.png'); ?>" alt="<?php bloginfo('name'); ?>" />
<img class="retina" src="<?php echo (ot_get_option('rb_logo_x2') != '' ? ot_get_option('rb_logo_x2') : ot_get_option('rb_logo', get_template_directory_uri().'/images/logo.png')); ?>" alt="<?php bloginfo('name'); ?>" />
</a>
</div>
-->
<div id="headerWidgets" class="clearfix">
<div class="left clearfix">
<?php if(is_active_sidebar('rb_header_widget_1'))
dynamic_sidebar('rb_header_widget_1'); ?>
</div>
<div class="right clearfix">
<?php if(is_active_sidebar('rb_header_widget_2'))
dynamic_sidebar('rb_header_widget_2'); ?>
</div>
</div>
<?php
/* if(!function_exists('is_woocommerce') || !is_woocommerce())
rb_breadcrumbs();
else if(function_exists('is_woocommerce') && is_woocommerce() && ot_get_option('rb_shop_bread', 'true') == 'true')
do_action('rb_custom_breadcrumb');
*/
?>
</div>
<!-- end headerContainer -->
</header>
<!-- Header End -->
<?php
/* JM - subcategory stuff */
if (isset($_REQUEST["f"])){
// $c=ucwords(str_replace("-", " ",$_REQUEST["f"]));
// $cat="$c ";
$slug=$_REQUEST["f"];
$obj=get_term_by( "slug", $slug, "portfolio_category");
$cat=$obj->name;
}
else{$cat="";}
?>
<?php if(!is_page_template('template-slider.php') && !is_page_template('template-slider-full.php') && ($custom_the_title != '' || get_post_meta($post->ID, 'rb_meta_box_t_show', true) == 'true')) : ?>
<div id="pageTitle" class="clearfix" >
<h1><?php echo $cat;?> <?php echo $custom_the_title == '' ? get_the_title() : $custom_the_title; ?> </h1>
<?php if(!(is_search() || is_404()) && get_post_meta($post->ID, 'rb_meta_box_t_link', true) != '') : ?>
<a href="<?php echo get_post_meta($post->ID, 'rb_meta_box_t_url', true); ?>" target="<?php echo get_post_meta($post->ID, 'rb_meta_box_t_target', true); ?>"><?php echo get_post_meta($post->ID, 'rb_meta_box_t_link', true); ?></a>
<?php endif; ?>
<?php if(is_single() && get_post_type() == 'post') : ?>
<nav class="postsNav">
<?php previous_post_link('<span class="prev">%link</span>');
next_post_link('<span class="next">%link</span>'); ?>
</nav>
<?php endif; ?>
</div>
<?php elseif (is_page_template('template-slider.php') && get_post_meta($post->ID, 'rb_meta_box_title2_show', true) == 'true') : ?>
<header class="rbTagline clearfix<?php if(get_post_meta($post->ID, 'rb_meta_box_title2_icon', true) != 'icon-none') echo ' wicon'; ?>">
<?php if(get_post_meta($post->ID, 'rb_meta_box_title2_title', true) != '') { ?>
<h1><?php echo get_post_meta($post->ID, 'rb_meta_box_title2_title', true); ?></h1>
<?php } if(get_post_meta($post->ID, 'rb_meta_box_title2_subtitle', true) != '') { ?>
<h2><?php echo get_post_meta($post->ID, 'rb_meta_box_title2_subtitle', true); ?></h2>
<?php } if(get_post_meta($post->ID, 'rb_meta_box_title2_icon', true) != 'icon-none') { ?>
<i class="i-medium <?php echo get_post_meta($post->ID, 'rb_meta_box_title2_icon', true); ?>"></i>
<?php } ?>
</header>
<?php endif; ?>
<!-- Content Wrapper Start -->
<?php if(is_page('projects')) : ?>
<article id="content" class="clearfix" style="margin-top:165px;">
<?php endif; ?>
<?php if(!is_page_template('template-slider-full.php') && !is_page('projects')) : ?>
<article id="content" class="clearfix whiteBackground" >
<?php endif; ?>