-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-splash.php
160 lines (135 loc) · 6.58 KB
/
template-splash.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
<?php
/**
* Template Name: Splash Page Template
* Created by PhpStorm.
* User: waqasriaz
* Date: 18/12/15
* Time: 3:49 PM
*/
get_header();
global $houzez_local, $post;
$search_template = houzez_get_template_link('template/template-search.php');
$background_type = houzez_option('backgroud_type');
$splash_welcome_text = houzez_option( 'splash_welcome_text' );
$page_head_subtitle = houzez_option( 'splash_welcome_sub' );
$splash_callus_icon = houzez_option( 'splash_callus_icon' );
$splash_callus_text = houzez_option( 'splash_callus_text' );
$splash_callus_phone = houzez_option( 'splash_callus_phone' );
$splash_overlay = houzez_option( 'splash_overlay' );
$splash_layout = houzez_option('splash_layout');
$image_ids = $ogv = $mp4 = $webm = $video_image = '';
$allowed_html = array(
'i' => array(
'class' => array()
)
);
if( $splash_overlay != 0 ) {
$overlay = 'true';
} else {
$overlay = 'false';
}
if( isset($_GET['splash_type'] ) ) {
$background_type = $_GET['splash_type'];
}
$bg_img = '';
if( $background_type == 'image' ) {
$image_url = houzez_option( 'splash_image', false, 'url' );
if (!empty($image_url)) {
$bg_img = esc_url ( $image_url );
}
} else if ( $background_type == 'slider' ) {
$image_ids = houzez_option( 'splash_slider' );
$image_ids = explode(',', $image_ids );
} else if( $background_type == 'video' ) {
$mp4 = houzez_option( 'splash_bg_mp4', false, 'url' );
$webm = houzez_option( 'splash_bg_webm', false, 'url' );
$ogv = houzez_option( 'splash_bg_ogv', false, 'url' );
$splash_video_image = houzez_option('splash_video_image', false, 'url');
$ogv = substr($ogv, 0, strrpos($ogv, "."));
$mp4 = substr($mp4, 0, strrpos($mp4, "."));
$webm = substr($webm, 0, strrpos($webm, "."));
$video_image = substr($splash_video_image, 0, strrpos($splash_video_image, "."));
}
?>
<section class="top-banner-wrap top-banner-wrap-fullscreen horizontal-search-wrap">
<div id="houzez-auto-complete-banner" class="auto-complete"></div>
<?php
if ( $background_type == 'slider' ) {
echo '<div class="splash-slider-wrap">';
if(!empty($image_ids)) {
foreach ( $image_ids as $id ) {
$url = wp_get_attachment_image_src($id, array(2000, 1000));
echo '<div class="splash-slider-item" style="background-image: url('.esc_url($url[0]).');"></div>';
}
}
echo '</div>';
} else if($background_type == 'video') {
echo '<div id="video-background" class="video-background splash-video-background" data-vide-bg="mp4: '.esc_url($mp4).', webm: '.esc_url($webm).', ogv: '.esc_url($ogv).', poster: '.esc_url($splash_video_image).'" data-vide-options="position: 0% 50%">
</div>';
} ?>
<?php if( $background_type == 'image' ) { ?>
<div class="banner-inner parallax d-flex" data-parallax-bg-image="<?php echo esc_url($bg_img); ?>">
<?php } else { ?>
<div class="banner-inner d-flex">
<?php } ?>
<div class="align-self-center flex-fill">
<div class="banner-caption">
<h2 class="banner-title"><?php echo $splash_welcome_text; ?></h2>
<p class="banner-subtitle"><?php echo $page_head_subtitle; ?></p>
<?php get_template_part('template-parts/search/search-for-banners'); ?>
</div><!-- banner-caption -->
</div><!-- align-self-center -->
</div><!-- banner-inner parallax -->
</section><!-- top-banner-wrap -->
<footer class="splash-page-footer">
<div class="d-flex justify-content-between">
<div class="splash-page-footer-left">
<i class="houzez-icon icon-messaging-whatsapp"></i> <?php echo esc_attr( $splash_callus_text ); ?> <?php echo esc_attr( $splash_callus_phone ); ?>
</div><!-- splash-page-footer-left -->
<?php if( houzez_option('social-splash')): ?>
<div class="splash-page-footer-right">
<div class="footer-social">
<span class="footer-social-title">
<?php echo $houzez_local['follow_us']; ?>
</span>
<?php if( houzez_option('sp-facebook') != '' ){ ?>
<span>
<a target="_blank" class="btn-facebook" href="<?php echo esc_url(houzez_option('sp-facebook')); ?>"><i class="houzez-icon icon-social-media-facebook mr-2"></i></a>
</span>
<?php } ?>
<?php if( houzez_option('sp-twitter') != '' ){ ?>
<span>
<a target="_blank" class="btn-twitter" href="<?php echo esc_url(houzez_option('sp-twitter')); ?>"><i class="houzez-icon icon-x-logo-twitter-logo-2 mr-2"></i></a>
</span>
<?php } ?>
<?php if( houzez_option('sp-linkedin') != '' ){ ?>
<span>
<a target="_blank" class="btn-linkedin" href="<?php echo esc_url(houzez_option('sp-linkedin')); ?>"><i class="houzez-icon icon-professional-network-linkedin mr-2"></i></a>
</span>
<?php } ?>
<?php if( houzez_option('sp-googleplus') != '' ){ ?>
<span>
<a target="_blank" class="btn-google-plus" href="<?php echo esc_url(houzez_option('sp-googleplus')); ?>"><i class="houzez-icon icon-social-media-google-plus-1 mr-2"></i></a>
</span>
<?php } ?>
<?php if( houzez_option('sp-instagram') != '' ){ ?>
<span>
<a target="_blank" class="btn-instagram" href="<?php echo esc_url(houzez_option('sp-instagram')); ?>"><i class="houzez-icon icon-social-instagram mr-2"></i></a>
</span>
<?php } ?>
<?php if( houzez_option('sp-tiktok') != '' ){ ?>
<span>
<a target="_blank" class="btn-tiktok" href="<?php echo esc_url(houzez_option('sp-tiktok')); ?>"><i class="houzez-icon icon-tiktok-1-logos-24 mr-2"></i></a>
</span>
<?php } ?>
<?php if( houzez_option('sp-telegram') != '' ){ ?>
<span>
<a target="_blank" class="btn-telegram" href="<?php echo esc_url(houzez_option('sp-telegram')); ?>"><i class="houzez-icon icon-telegram-logos-24 mr-2"></i></a>
</span>
<?php } ?>
</div><!-- footer-social -->
</div><!-- splash-page-footer-right -->
<?php endif; ?>
</div><!-- d-flex -->
</footer><!-- splash-page-footer -->
<?php get_footer(); ?>