-
Notifications
You must be signed in to change notification settings - Fork 4
/
slider.php
43 lines (41 loc) · 1.49 KB
/
slider.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
<?php
/*
================================================================================================
The slider containing the carousel animation
================================================================================================
@package Maria
@link https://developer.wordpress.org/themes/basics/template-files/#template-partials
@copyright Copyright (C) 2017. Samuel Guebo
@license GNU General Public License v2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
@author Samuel Guebo (http://samuelguebo.co/)
================================================================================================
*/
?>
<?php //starting slider loop;
$sliders = Maria_Kirki::get_option( 'slider_repeater');
if(is_array($sliders)):?>
<!-- Slides: Images and Captions -->
<section id="slider" class="row slider-wrapper">
<?php
foreach ( $sliders as $post ) : setup_postdata( $post );
get_template_part('template-parts/content','slide');
endforeach; ?>
</section>
<?php endif; wp_reset_postdata(); $sliders = null;?>
<!-- Javascript setting for the slider -->
<script>
jQuery(document).ready(function ($) {
// Initialize Homepage slider
$('.slider-wrapper').slick({
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 4000,
swipe: true,
pauseOnHover: true,
swipeToSlide: true,
arrows: true,
fade: true
});
});
</script>