-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
207 lines (144 loc) · 5.7 KB
/
header.php
File metadata and controls
207 lines (144 loc) · 5.7 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
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
<?php
/**
* The header for our theme
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package codexin
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=9">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!--[if IE 9]>
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/ie9.css">
<![endif]-->
<?php wp_head(); ?>
</head>
<body <?php if( is_front_page()) : body_class('homepage'); else : body_class(); endif; ?>>
<?php global $codexin; ?>
<div id="preloader">
<div id="status">
<img src="<?php echo get_template_directory_uri(); ?>/images/loader.gif" height="60" width="60" alt="">
<div class="loader">Loading...</div>
</div>
</div>
<!-- Header
=================================================== -->
<header id="main-header">
<div class="row header-inner">
<div class="logo">
<a class="smoothscroll" href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php if( ! empty( $codexin['pm-logo'] ) ) : echo $codexin['pm-logo']; endif; ?>
</a>
</div>
<nav id="nav-wrap">
<a class="mobile-btn" href="#nav-wrap" title="Show navigation">
<span class='menu-text'>Show Menu</span>
<span class="menu-icon"></span>
</a>
<a class="mobile-btn" href="#" title="Hide navigation">
<span class='menu-text'>Hide Menu</span>
<span class="menu-icon"></span>
</a>
<?php echo get_main_menu(); ?>
</nav> <!-- /nav-wrap -->
</div> <!-- /header-inner -->
</header>
<?php if( is_front_page() ) : ?>
<!-- Hero
=================================================== -->
<section id="hero">
<div class=" hero-content">
<div class="twelve columns flex-container">
<div id="hero-slider" class="flexslider">
<ul class="slides">
<?php
$args = array(
'post_type' => 'puremedia-slider',
'post_per_page' => -1,
);
$slider = new WP_Query( $args);
//Check posts
if( $slider->have_posts() ) :
//Start loop here..
while( $slider->have_posts() ) : $slider->the_post();
$get_image = get_the_post_thumbnail_url();
$image = ( ! empty( $get_image) ) ? $get_image : '';
?>
<!-- Slide -->
<li style=" background: #12151b url(<?php echo esc_attr( $image ); ?>) no-repeat center center fixed;">
<div class="flex-caption">
<h1>
<?php
$slider_content = rwmb_meta( 'codexin_slider_content', 'type=textarea' );
$content = ( !empty($slider_content) ) ? $slider_content : '';
echo esc_html( $content ); ?>
</h1>
<p>
<?php
$rm_url = rwmb_meta( 'codexin_button_link', 'type=text' );
$tr_url = rwmb_meta( 'codexin_link_target', 'type=text' );
$getUrl = ( !empty($rm_url) ) ? $rm_url : '';
$target = ( !empty($tr_url) ) ? $tr_url : '';
?>
<a class="button stroke smoothscroll" href="<?php echo esc_url( $getUrl ); ?>" target="<?php echo esc_attr( $target ); ?>">
<?php
$btn_text = rwmb_meta( 'codexin_button_text', 'type=text' );
$text = ( !empty($btn_text) ) ? $btn_text : '';
echo $text;
?>
</a>
</p>
</div>
</li>
<?php
endwhile;
endif;
wp_reset_postdata();
?>
</ul> <!-- end of slide -->
</div> <!-- .flexslider -->
</div> <!-- .flex-container -->
</div> <!-- .hero-content -->
</section> <!-- #hero -->
<?php else : ?>
<!-- Page Title
================================================== -->
<?php
$header_bg = rwmb_meta('codexin_page_background', 'type=image_advanced');
foreach ($header_bg as $single_bg) {
# code...
$single_bg = $single_bg['full_url'];
}
?>
<section id="page-title" <?php if (!empty($single_bg)): ?> style="background-image: url('<?php echo $single_bg; ?>')" <?php endif; ?>>
<div class="row">
<div class="twelve columns">
<h1>
<?php
if(is_home()):
echo "Blog";
elseif(is_404()):
echo "Nothing Found!";
elseif(is_archive()):
the_archive_title();
elseif(is_search()):
printf( esc_html__( 'Search Results for: %s', 'puremedia' ), '<span>' . get_search_query() . '</span>' );
else:
single_post_title();
endif;
?><span>.</span></h1>
<p><?php bloginfo( 'description' ); ?></p>
</div>
</div> <!-- /row -->
</section> <!-- /page-title -->
<?php endif; ?>