home_page.php
3.97 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
<?php
/*
* Template Name: Home Page
*/
get_header("home");
$product_sub_text = get_field('product_sub_text', $post->ID, true);
$header_part_image_mobile = get_field('mobile_header_image');
$anncouncement = get_field('announcements');
?>
<div id="homecontent" class="home-content">
<?php if(!empty($anncouncement)) { ?>
<!-- Change cookie name for new banner -->
<div id="COVID-19-home-info-bar" class="hide"><button class="closeHomeBanner" type="button">x</button>
<?= $anncouncement ?></div>
<?php } ?>
<div id="carousel-cont">
<div id="carousel" class="carousel slide" data-ride="carousel" data-type="multi">
<div class="carousel-inner">
<div class="carousel-col">
<div class="head-image"><?= get_the_post_thumbnail() ?></div>
<div class='header-image-mobile'>
<img src='<?= (!empty($header_part_image_mobile)) ? $header_part_image_mobile['sizes']['large'] : "" ?>' alt="home-page"/>
</div>
</div>
</div>
<!-- <div class="left carousel-control" >
<a href="#carousel" role="button" data-slide="prev">
<span class="glyphicon prev-custom-control" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
</div>
<div class="right carousel-control" >
<a href="#carousel" role="button" data-slide="next">
<span class="glyphicon custom-control" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div> -->
</div>
</div>
<!--
<div id="carouselButtons" style="display:none">
<button id="playButton" type="button" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-play"></span>
</button>
<button id="pauseButton" type="button" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-pause"></span>
</button>
</div> -->
<div class="header_tag_line"><?= get_the_content() ?></div>
<div class="hr"></div>
<div class="body-padding">
<div class="row product-row">
<h1 style='text-align:center'>PROTECT ALL YOU OWN</h1>
<p><?php echo $product_sub_text; ?></p>
</div>
<div class="row">
<?php
if (function_exists(clean_home_custom_menus())) {
clean_home_custom_menus();
}
?>
</div>
</div>
<div class="hr"></div>
<?= get_field('care_to_grow') ?>
<?= do_shortcode('[care-to-grow]') ?>
</div>
<script>
jQuery(function($) {
$('#carousel').carousel({
interval: false,
pause: "false",
});
$('#playButton').click(function() {
$('#carousel').carousel('cycle');
});
$('#pauseButton').click(function() {
$('#carousel').carousel('pause');
});
setTimeout(function() {
$('#carouselButtons').hide();
$('#pauseButton').click();
if ($(window).width() < 768) {
$("#carousel").swiperight(function() {
$(this).carousel('prev');
});
$("#carousel").swipeleft(function() {
$(this).carousel('next');
});
};
if ($(window).width() > 1350) {
// $('#pauseButton').click();
// console.log('pause');
// $('#carouselButtons').hide();
$('.carousel-control a').attr('tabindex', '-1');
} else {
// console.log('play');
// $('#playButton').click();
// $('#carouselButtons').show();
$('.carousel-control a').attr('tabindex', '0');
};
}, 1000);
$('.head-image').attr('tabindex', '0');
});
</script>
<?php wp_reset_query();?>
<style>
.home-page-link {
display: inline-block !important;
}
.broker-footer-login {
display: none !important;
}
</style>
</div>
<?php get_footer();?>