<div id="emmeSlider" class="emme_slider owl-carousel <?=$atts['class']?>">
<?php
foreach ($images as $image) {
if(wp_is_mobile()){
$thumb = 'medium';
} else{
$thumb = 'big';
}
$urlImage = wp_get_attachment_image_url($image, $thumb);
$gallery = '<div class="emme-slider-item" style="background-image: url('.$urlImage.');">';
//$gallery .= '<a data-lightbox="'.$light.'" data-title="'.wp_get_attachment_caption($image).'" title="'.get_the_title($image).'" href="'.wp_get_attachment_image_url($image, 'full').'" >';
// $gallery .= wp_get_attachment_image($image, $atts['thumb'], false, array('alt' => get_the_title($image)));
//$gallery .= '</a>';
if($atts['title'] != 'No' || $atts['description'] != 'No'){
$gallery .= '<div class="txt">';
if(get_the_title($image) && $atts['title'] != 'No'){
$gallery .= '<div class="tit">'.get_the_title($image).'</div>';
}
if(wp_get_attachment_caption($image) && $atts['description'] != 'No'){
$gallery .= '<figcaption>'.wp_get_attachment_caption($image).'</figcaption>';
}
$gallery .= '</div>';
}
$gallery .= '</div>';
echo $gallery;
}
?>
</div>
<script type="text/javascript">
jQuery(document).ready(function(e) {
jQuery('.emme_slider.owl-carousel').owlCarousel({
margin: 0,
loop: <?= $atts['loop'] ?>,
autoplay: <?= $atts['autoplay'] ?>,
autoplayTimeout: <?= $atts['timeout'] ?>,
nav: <?= $atts['nav'] ?>,
dots: <?= $atts['dots'] ?>,
items: 1,
lazyLoad: true,
});
});
</script>
All system for education purposes only. For more tools: Telegram @jackleet