-
Notifications
You must be signed in to change notification settings - Fork 1
/
header.php
272 lines (204 loc) · 9.76 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
<?php if (!defined('ABSPATH')) die('No direct access allowed'); ?>
<!DOCTYPE html>
<!--[if lte IE 8]> <html class="ie8 no-js" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 9]> <html class="ie9 no-js" <?php language_attributes(); ?>> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="not-ie no-js" <?php language_attributes(); ?>> <!--<![endif]-->
<head>
<?php get_template_part('header', 'seocode'); ?>
<!-- Google Web Fonts
================================================== -->
<?php echo TMM_HelperFonts::get_google_fonts_link() ?>
<!-- Basic Page Needs
================================================== -->
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<!--[if ie]><meta http-equiv='X-UA-Compatible' content="IE=edge,IE=9,IE=8,chrome=1" /><![endif]-->
<?php
$favicon = TMM::get_option("favicon_img");
if ($favicon) :
?>
<link href="<?php echo $favicon; ?>" rel="icon" type="image/x-icon" />
<?php else: ?>
<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri() ?>/favicon.ico" type="image/x-icon" />
<?php endif; ?>
<!-- Mobile Specific Metas
================================================== -->
<?php if (!isset($content_width)) $content_width = 960; ?>
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url') ?>" />
<!-- CSS
================================================== -->
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_head(); ?>
</head>
<?php echo TMM::get_option("tracking_code"); ?>
<?php
$_REQUEST['PAGE_ID'] = 0;
if (is_single() OR is_page() OR is_front_page()) {
global $post;
$_REQUEST['PAGE_ID'] = $post->ID;
}
?>
<body <?php body_class(); ?>>
<div id="fb-root"></div>
<!-- - - - - - - - - - - - - - Header - - - - - - - - - - - - - - - - -->
<header id="header" <?php if ($_REQUEST['PAGE_ID'] > 0): ?><?php echo TMM_Helper::get_header_bg($_REQUEST['PAGE_ID']) ?><?php endif; ?>>
<div class="container">
<div class="sixteen columns">
<div id="logo">
<?php
$logo_type = TMM::get_option("logo_type");
$logo_text = TMM::get_option("logo_text");
$logo_img = TMM::get_option("logo_img");
if (!$logo_type AND $logo_text) {
?>
<h1><a title="<?php bloginfo('description'); ?>" href="<?php echo home_url(); ?>"><?php echo $logo_text; ?></a></h1>
<?php } else if ($logo_type AND $logo_img) { ?>
<a title="<?php bloginfo('description'); ?>" href="<?php echo home_url(); ?>"><img src="<?php echo $logo_img; ?>" alt="<?php bloginfo('description'); ?>" /></a>
<?php } else { ?>
<h1><a title="<?php bloginfo('description'); ?>" href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a></h1>
<?php } ?>
</div>
<nav id="navigation" class="navigation">
<?php wp_nav_menu(array('theme_location' => 'primary', 'container_class' => false)); ?>
</nav><!--/ #navigation-->
</div><!--/ .columns-->
</div><!--/ .container-->
</header><!--/ #header-->
<!-- - - - - - - - - - - - - - end Header - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - Header - - - - - - - - - - - - - - - - -->
<?php
$sidebar_position = "sbr";
$_REQUEST['sidebar_position'] = $sidebar_position;
if (is_single() AND $post->post_type == TMM_Portfolio::$slug) {
$_REQUEST['sidebar_position'] = 'no_sidebar';
$sidebar_position = 'no_sidebar';
} else {
$page_sidebar_position = "default";
if (!is_404()) {
if (is_single() OR is_page()) {
$page_sidebar_position = get_post_meta(get_the_ID(), 'page_sidebar_position', TRUE);
}
if (!empty($page_sidebar_position) AND $page_sidebar_position != 'default') {
$sidebar_position = $page_sidebar_position;
} else {
$sidebar_position = TMM::get_option("sidebar_position");
}
if (!$sidebar_position) {
$sidebar_position = "sbr";
}
//*****
} else {
$sidebar_position = 'no_sidebar';
}
}
//***
//is portfolio archive
if (is_archive()) {
if (is_post_type_archive(TMM_Portfolio::$slug)) {
$sidebar_position = TMM::get_option('folio_archive_sidebar');
if (empty($sidebar_position)) {
$sidebar_position = 'no_sidebar';
}
}
}
$_REQUEST['sidebar_position'] = $sidebar_position;
if (is_post_type_archive() == TMM_Portfolio::$slug) {
if (is_archive()) {
$_REQUEST['sidebar_position'] = 'sbr';
$sidebar_position = 'sbr';
}
}
?>
<!-- - - - - - - - - - - - - - - - Dynamic Content - - - - - - - - - - - - - - - - -->
<div id="wrapper" class="<?php echo $sidebar_position ?>" <?php if ($_REQUEST['PAGE_ID'] > 0): ?>style="<?php echo TMM_Helper::get_page_backround($_REQUEST['PAGE_ID']) ?>"<?php endif; ?>>
<div id="content">
<!-- - - - - - - - - - - - - - Container - - - - - - - - - - - - - - - - -->
<div class="container ajax">
<?php
$slider_html = "";
if ($_REQUEST['PAGE_ID'] > 0 AND is_object($post)) {
$slider_html = TMM_Ext_Sliders::draw_page_slider($_REQUEST['PAGE_ID']);
}
?>
<?php if (empty($slider_html)): ?>
<?php
$page_title_status = 'show';
if ($_REQUEST['PAGE_ID'] > 0 AND is_object($post)) {
$page_title_status = get_post_meta($_REQUEST['PAGE_ID'], 'page_title_status', TRUE);
if (!$page_title_status) {
$page_title_status = 'show';
}
}
?>
<?php if ($page_title_status == 'show'): ?>
<div class="page-header">
<?php if (is_404()): ?>
<h1><?php _e("Page not Found", 'almera') ?></h1>
<?php else: ?>
<?php if (is_home()): ?>
<h1><?php bloginfo('description'); ?></h1>
<?php endif; ?>
<?php if (is_single() OR is_page()): ?>
<h1 <?php echo ((strlen($post->post_title) > 23) ? "class='font-small'" : '') ?>><?php echo $post->post_title ?></h1>
<?php endif; ?>
<?php if (is_search()): ?>
<h1><?php printf(__('Search Results for: %s', 'almera'), '<span>' . get_search_query() . '</span>'); ?></h1>
<?php endif; ?>
<?php if (is_tag()): ?>
<h1><?php printf(__('Tag Archives: %s', 'almera'), '<span>' . single_tag_title('', false) . '</span>'); ?></h1>
<?php endif; ?>
<?php
$queried_object = get_queried_object();
$is_defined = false;
?>
<?php if (is_object($queried_object)): ?>
<?php if ($queried_object->taxonomy == 'foliocat'): $is_defined = true; ?>
<h1><?php printf(__('Folios by Categories: %s', 'almera'), '<span>' . $queried_object->name . '</span>'); ?></h1>
<?php endif; ?>
<?php endif; ?>
<?php if (is_archive() AND !$is_defined): ?>
<?php if (is_post_type_archive(TMM_Portfolio::$slug)): ?>
<h1 class="page-title">
<?php if (is_day()) : ?>
<?php printf(__('Daily Portfolio Archives: %s', 'almera'), '<span>' . get_the_date() . '</span>'); ?>
<?php elseif (is_month()) : ?>
<?php printf(__('Monthly Portfolio Archives: %s', 'almera'), '<span>' . get_the_date(_x('F Y', 'monthly archives date format', 'almera')) . '</span>'); ?>
<?php elseif (is_year()) : ?>
<?php printf(__('Yearly Portfolio Archives: %s', 'almera'), '<span>' . get_the_date(_x('Y', 'yearly archives date format', 'almera')) . '</span>'); ?>
<?php else : ?>
<?php _e('Portfolio Archives', 'almera'); ?>
<?php endif; ?>
</h1>
<?php endif; ?>
<?php if (is_object($queried_object)): ?>
<?php if ($queried_object->taxonomy == 'category'):$is_defined = true; ?>
<h1><?php printf(__('Category: %s', 'almera'), '<span>' . $queried_object->name . '</span>'); ?></h1>
<?php endif; ?>
<?php endif; ?>
<?php if (is_post_type_archive() != TMM_Portfolio::$slug AND $is_defined == false AND !is_page()): ?>
<h1 class="page-title">
<?php if (is_day()) : ?>
<?php printf(__('Daily Archives: %s', 'almera'), '<span>' . get_the_date() . '</span>'); ?>
<?php elseif (is_month()) : ?>
<?php printf(__('Monthly Archives: %s', 'almera'), '<span>' . get_the_date(_x('F Y', 'monthly archives date format', 'almera')) . '</span>'); ?>
<?php elseif (is_year()) : ?>
<?php printf(__('Yearly Archives: %s', 'almera'), '<span>' . get_the_date(_x('Y', 'yearly archives date format', 'almera')) . '</span>'); ?>
<?php else : ?>
<?php _e('Blog Archives', 'almera'); ?>
<?php endif; ?>
</h1>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</div><!--/ .page-header-->
<?php endif; ?>
<?php else: ?>
<!-- - - - - - - - - - - - - Slider - - - - - - - - - - - - - - - -->
<div class="slider">
<?php echo $slider_html ?>
</div>
<!-- - - - - - - - - - - - - end Slider - - - - - - - - - - - - - - -->
<?php endif; ?>
<?php if ($_REQUEST['sidebar_position'] != 'no_sidebar'): ?><section class="twelve columns" id="main"><?php endif; ?>