File: /home/thuexe247c/public_html/wp-content/plugins/sliderkits/templates/carousel-slider.php
<?php
/**
* The carousel slider template
* If you want to override this template by your custom template in the theme folder,
* just create the 'sliderkits' folder in the theme folder,
* then, copy this file to sliderkits folder.
* @version 1.0.0
* @package SliderKits
*/
$slidesToShow = $sk_data->slidesToShow;
$autoplay = $sk_data->autoplay;
$autoplaySpeed = $sk_data->autoplaySpeed;
$dots = $sk_data->dots;
$infinite = $sk_data->infinite;
$swipe = $sk_data->swipe;
$touchMove = $sk_data->touchMove;
$speed = $sk_data->speed;
$slides = $sk_data->slides;
$hover_animation = $sk_data->button_hover_animation;
$carousel_slider_config = json_encode([
'autoplay' => $autoplay === 'true'? true: false,
'autoplaySpeed' => $autoplaySpeed,
'infinite' => $infinite === 'true'? true: false,
'dots' => $dots === 'true'? true: false,
'swipe' => $swipe === 'true'? true: false,
'speed' => $speed,
'touchMove' => $touchMove === 'true'? true: false,
'fade' => false,
'lazyLoad' => 'ondemand',
'slidesToShow' => $slidesToShow === '2' ? 2 : 3,
'responsive' => [
[
"breakpoint" => 767,
"settings" => [
"slidesToShow" => 2
]
],
[
"breakpoint" => 640,
"settings" => [
"slidesToShow" => 1
]
]
]
]);
?>
<?php if( $slides ) : ?>
<div class="sk-slick sk-slick-carousel" data-slick='<?php echo esc_attr( $carousel_slider_config ); ?>'>
<?php
foreach( $slides as $item ):
$target = $item['button_link']['is_external'] ? 'target="_blank"' : '';
?>
<div class="sk-slick-item d-flex align-items-center elementor-repeater-item-<?php echo esc_attr( $item['_id'] ); ?>">
<div class="sk-slick-item__container container">
<div class="sk-img-side">
<?php if( $item['button_link']['url'] !== '' ): ?>
<a href="<?php echo esc_url( $item['button_link']['url'] ); ?>" <?php echo esc_html( $target );?>
<?php endif; ?>
<?php
$picture_url = $item['picture']['url'];
if( $picture_url !== '' ):
?>
<img class="lazyload" src="<?php echo wp_get_attachment_image_url( $item['picture']['id'], 'medium' );?>" data-src="<?php echo esc_url( $picture_url ); ?>" alt="<?php echo esc_attr( $item['title'] ); ?>" />
<?php endif; ?>
<?php if( $item['button_link']['url'] !== '' ): ?>
</a>
<?php endif;?>
</div>
<div class="sk-text-side">
<?php if( $item['title'] ): ?>
<h1 class="sk-heading sk-wrap-lines"><span><?php echo wp_kses_post( $item['title'] ); ?></span></h1>
<?php endif; ?>
<?php if( $item['subtitle'] ): ?>
<h2 class="sk-subheading sk-wrap-lines"><span><?php echo wp_kses_post( $item['subtitle'] ); ?></span></h2>
<?php endif; ?>
<?php if( $item['button_text'] ):?>
<div class="sk-button-container">
<a href="<?php echo esc_url( $item['button_link']['url'] );?>" class="elementor-button sk-button elementor-animation-<?php echo esc_attr( $hover_animation ); ?>" <?php echo esc_html( $target );?>><?php echo esc_html( $item['button_text'] ); ?> →</a>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>