/
clients.php
executable file
·56 lines (52 loc) · 1.95 KB
/
clients.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
<?php
$images = explode('^', $titles);
$links = explode('^', $content);
$max = count($images)-1;
$uniqid = uniqid();
if (!class_exists('TMM')) {
tmm_enqueue_script('owlcarousel');
tmm_enqueue_style('owlcarousel');
tmm_enqueue_style('owltheme');
tmm_enqueue_style('owltransitions');
}
$slides_count = ceil(count($images)/$items_per_slide);
?>
<?php if (!empty($images)){ ?>
<div class="clients-items-<?php echo esc_attr($uniqid) ?> clients-items clearfix">
<?php
$k=1;
for ($s=0; $s<$slides_count; $s++){ ?>
<div class="item">
<ul>
<?php for ($i=$items_per_slide*($k-1); $i<($items_per_slide*$k); $i++){
if(isset($images[$i])){
?>
<li>
<a href="<?php echo(!empty($links[$i]) ? $links[$i] : '#') ?>"><img alt="" src="<?php echo esc_url(TMM_Content_Composer::resize_image($images[$i], '')) ?>"></a>
</li>
<?php
}
} ?>
</ul>
</div>
<?php
$k++;
} ?>
</div>
<script>
jQuery(function() {
if (jQuery('.clients-items-<?php echo esc_js($uniqid) ?> .item').length>1){
jQuery('.clients-items-<?php echo esc_js($uniqid) ?>').owlCarousel({
autoPlay : 5000,
stopOnHover : true,
navigation: false,
slideSpeed: 300,
paginationSpeed: 400,
singleItem: true,
theme : "owl-theme",
transitionStyle : "<?php echo (isset($animation_type)&&(!empty($animation_type))) ? esc_js($animation_type) : 'scaleToFade' ?>"
});
}
});
</script>
<?php }