-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
236 lines (215 loc) · 10.6 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
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div class="container">
*
* @package Makeup Lite
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
<?php endif; ?>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
} else {
do_action( 'wp_body_open' );
}
?>
<a class="skip-link screen-reader-text" href="#makeup_content_wrap">
<?php esc_html_e( 'Skip to content', 'makeup-lite' ); ?>
</a>
<?php
$makeup_lite_show_header_contactarea = esc_attr( get_theme_mod('makeup_lite_show_header_contactarea', false) );
$makeup_lite_show_social_sections = esc_attr( get_theme_mod('makeup_lite_show_social_sections', false) );
$makeup_lite_show_frontslide_section = esc_attr( get_theme_mod('makeup_lite_show_frontslide_section', false) );
$makeup_lite_show_2column_pagebx = esc_attr( get_theme_mod('makeup_lite_show_2column_pagebx', false) );
$makeup_lite_show_welcometosite = esc_attr( get_theme_mod('makeup_lite_show_welcometosite', false) );
?>
<div id="sitelayout" <?php if( get_theme_mod( 'makeup_lite_site_layout_options' ) ) { echo 'class="boxlayout"'; } ?>>
<?php
if ( is_front_page() && !is_home() ) {
if( !empty($makeup_lite_show_frontslide_section)) {
$inner_cls = '';
}
else {
$inner_cls = 'siteinner';
}
}
else {
$inner_cls = 'siteinner';
}
?>
<div class="site-header <?php echo esc_attr($inner_cls); ?> ">
<div class="container">
<div class="logo">
<?php makeup_lite_the_custom_logo(); ?>
<h1><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo('name'); ?></a></h1>
<?php $description = get_bloginfo( 'description', 'display' );
if ( $description || is_customize_preview() ) : ?>
<p><?php echo esc_html($description); ?></p>
<?php endif; ?>
</div><!-- logo -->
<div class="hdr_contact_details">
<?php $makeup_lite_header_phoneno = get_theme_mod('makeup_lite_header_phoneno');
if( !empty($makeup_lite_header_phoneno) ){ ?>
<div class="infobox">
<i class="fas fa-phone-volume"></i>
<span><?php echo esc_html($makeup_lite_header_phoneno); ?></span>
</div>
<?php } ?>
<?php
$email = get_theme_mod('makeup_lite_header_emailid');
if( !empty($email) ){ ?>
<div class="infobox">
<i class="fas fa-envelope-open-text"></i>
<span>
<a href="<?php echo esc_url('mailto:'.sanitize_email($email)); ?>"><?php echo sanitize_email($email); ?></a>
</span>
</div>
<?php } ?>
<?php if( $makeup_lite_show_social_sections != ''){ ?>
<div class="infobox">
<div class="hdr_social">
<?php $makeup_lite_facebook_link = get_theme_mod('makeup_lite_facebook_link');
if( !empty($makeup_lite_facebook_link) ){ ?>
<a class="fab fa-facebook-f" target="_blank" href="<?php echo esc_url($makeup_lite_facebook_link); ?>"></a>
<?php } ?>
<?php $makeup_lite_twitter_link = get_theme_mod('makeup_lite_twitter_link');
if( !empty($makeup_lite_twitter_link) ){ ?>
<a class="fab fa-twitter" target="_blank" href="<?php echo esc_url($makeup_lite_twitter_link); ?>"></a>
<?php } ?>
<?php $makeup_lite_googleplus_link = get_theme_mod('makeup_lite_googleplus_link');
if( !empty($makeup_lite_googleplus_link) ){ ?>
<a class="fab fa-google-plus" target="_blank" href="<?php echo esc_url($makeup_lite_googleplus_link); ?>"></a>
<?php }?>
<?php $makeup_lite_linkedin_link = get_theme_mod('makeup_lite_linkedin_link');
if( !empty($makeup_lite_linkedin_link) ){ ?>
<a class="fab fa-linkedin" target="_blank" href="<?php echo esc_url($makeup_lite_linkedin_link); ?>"></a>
<?php } ?>
<?php $makeup_lite_instagram_link = get_theme_mod('makeup_lite_instagram_link');
if( !empty($makeup_lite_instagram_link) ){ ?>
<a class="fab fa-instagram" target="_blank" href="<?php echo esc_url($makeup_lite_instagram_link); ?>"></a>
<?php } ?>
</div><!--end .hdr_social-->
</div><!--end .infobox-->
<?php } ?>
</div><!--end .hdr_contact_details-->
<div class="clear"></div>
<div id="hdrnavigator">
<button class="menu-toggle" aria-controls="main-navigation" aria-expanded="false" type="button">
<span aria-hidden="true"><?php esc_html_e( 'Menu', 'makeup-lite' ); ?></span>
<span class="dashicons" aria-hidden="true"></span>
</button>
<nav id="main-navigation" class="site-navigation primary-navigation" role="navigation">
<?php
wp_nav_menu( array(
'theme_location' => 'primary',
'container' => 'ul',
'menu_id' => 'primary',
'menu_class' => 'primary-menu menu',
) );
?>
</nav><!-- .site-navigation -->
<div class="clear"></div>
</div><!-- #hdrnavigator -->
</div><!-- .container -->
</div><!--.site-header -->
<?php
if ( is_front_page() && !is_home() ) {
if($makeup_lite_show_frontslide_section != '') {
for($i=1; $i<=3; $i++) {
if( get_theme_mod('makeup_lite_frontslidebx'.$i,false)) {
$slider_Arr[] = absint( get_theme_mod('makeup_lite_frontslidebx'.$i,true));
}
}
?>
<div class="slider_wrapper">
<?php if(!empty($slider_Arr)){ ?>
<div id="slider" class="nivoSlider">
<?php
$i=1;
$slidequery = new WP_Query( array( 'post_type' => 'page', 'post__in' => $slider_Arr, 'orderby' => 'post__in' ) );
while( $slidequery->have_posts() ) : $slidequery->the_post();
$image = wp_get_attachment_url( get_post_thumbnail_id($post->ID));
$thumbnail_id = get_post_thumbnail_id( $post->ID );
$alt = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true);
?>
<?php if(!empty($image)){ ?>
<img src="<?php echo esc_url( $image ); ?>" title="#slidecaption<?php echo esc_attr( $i ); ?>" alt="<?php echo esc_attr($alt); ?>" />
<?php }else{ ?>
<img src="<?php echo esc_url( get_template_directory_uri() ) ; ?>/images/slides/slider-default.jpg" title="#slidecaption<?php echo esc_attr( $i ); ?>" alt="<?php echo esc_attr($alt); ?>" />
<?php } ?>
<?php $i++; endwhile; ?>
</div>
<?php
$j=1;
$slidequery->rewind_posts();
while( $slidequery->have_posts() ) : $slidequery->the_post(); ?>
<div id="slidecaption<?php echo esc_attr( $j ); ?>" class="nivo-html-caption">
<h2><?php the_title(); ?></h2>
<?php the_excerpt(); ?>
<?php
$makeup_lite_frontslide_moretext = get_theme_mod('makeup_lite_frontslide_moretext');
if( !empty($makeup_lite_frontslide_moretext) ){ ?>
<a class="slide_morebtn" href="<?php the_permalink(); ?>"><?php echo esc_html($makeup_lite_frontslide_moretext); ?></a>
<?php } ?>
</div>
<?php $j++;
endwhile;
wp_reset_postdata(); ?>
<?php } ?>
</div><!-- .slider_wrapper -->
<?php } } ?>
<?php if ( is_front_page() && ! is_home() ) { ?>
<section id="front_services_boxes">
<div class="container">
<?php if( $makeup_lite_show_2column_pagebx != ''){ ?>
<div class="services_leftpart <?php if( empty($makeup_lite_show_frontslide_section)) { echo 'noslider'; } ?>">
<?php
for($n=1; $n<=4; $n++) {
if( get_theme_mod('makeup_lite_2column_pagebx'.$n,false)) {
$queryvar = new WP_Query('page_id='.absint(get_theme_mod('makeup_lite_2column_pagebx'.$n,true)) );
while( $queryvar->have_posts() ) : $queryvar->the_post(); ?>
<div class="twocolumnbx <?php if($n % 2 == 0) { echo "last_column"; } ?>">
<?php if(has_post_thumbnail() ) { ?>
<div class="thumbbx"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a></div>
<?php } ?>
<div class="boxdescription">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php the_excerpt(); ?>
</div>
</div>
<?php endwhile;
wp_reset_postdata();
} } ?>
<div class="clear"></div>
</div><!-- .services_rightpart -->
<?php } ?>
<?php if( $makeup_lite_show_welcometosite != ''){ ?>
<div class="services_rightpart">
<?php
if( get_theme_mod('makeup_lite_page_for_welcometosite',false)) {
$queryvar = new WP_Query('page_id='.absint(get_theme_mod('makeup_lite_page_for_welcometosite',true)) );
while( $queryvar->have_posts() ) : $queryvar->the_post(); ?>
<h3><?php the_title(); ?></h3>
<?php the_content(); ?>
<a class="learnmore" href="<?php the_permalink(); ?>"><?php esc_html_e('Read More','makeup-lite'); ?></a>
<?php endwhile;
wp_reset_postdata(); ?>
<?php } ?>
</div><!-- .services_leftpart -->
<?php } ?>
<div class="clear"></div>
</div><!-- .container -->
</section><!-- #front_services_boxes -->
<?php } ?>