| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; // Exit if accessed directly. |
| 4 |
} |
| 5 |
|
| 6 |
// Set a global variable to indicate the current template |
| 7 |
global $ova_elems_template; |
| 8 |
$ova_elems_template = 'template5'; |
| 9 |
|
| 10 |
$total_slides = count($slides); |
| 11 |
$activeSlideIndex = $static_settings['active_slide_index'] ?? 0; |
| 12 |
|
| 13 |
wp_enqueue_style('ova-elems-style5', OVA_ELEMS_URL . 'assets/css/style5.css', array(), OVA_ELEMS_VER); |
| 14 |
wp_enqueue_script('ova-elems-template-5-frontend-scripts', OVA_ELEMS_URL . 'assets/js/template-5-scripts.js', array('jquery'), OVA_ELEMS_VER, true); |
| 15 |
|
| 16 |
// Prepare dynamic settings for the slider |
| 17 |
$dynamic_settings = [ |
| 18 |
'autoplay' => (!empty($static_settings['autoplay']) && $static_settings['autoplay'] == '1') ? ($static_settings['autoplay_delay'] ?? 1000) : false, // Autoplay delay |
| 19 |
'effect' => $static_settings['effect'] ?? '', |
| 20 |
'crossFade' => !empty($static_settings['fade_crossfade']), |
| 21 |
'lazyLoad' => !empty($static_settings['lazy_load']) && $static_settings['lazy_load'] == '1' ? true : false, |
| 22 |
'autoplay_delay' => isset($static_settings['autoplay_delay']) ? absint($static_settings['autoplay_delay']) : 1000, |
| 23 |
]; |
| 24 |
|
| 25 |
// Localize the script |
| 26 |
wp_localize_script('ova-elems-template-5-frontend-scripts', 'template5SliderConfig', $dynamic_settings); |
| 27 |
?> |
| 28 |
|
| 29 |
<body> |
| 30 |
<section class="oe-circular-slider" |
| 31 |
style="background-image: url('<?php echo esc_url(isset($static_settings['bg_slide_image']) ? $static_settings['bg_slide_image'] : ''); ?>'); background-size: cover; background-position: center; background-repeat: no-repeat;"> |
| 32 |
<div class="oe-circular-slider-after"> |
| 33 |
<div class="oe-inner-wrap"> |
| 34 |
|
| 35 |
|
| 36 |
<div class="nav-position-helper swiper-container"> |
| 37 |
<div class="swiper-wrapper"> |
| 38 |
<?php foreach ($slides as $index => $slide): ?> |
| 39 |
<div class="swiper-slide slider-main-image-<?php echo esc_attr($post->ID); ?>-<?php echo esc_attr($index); ?> " |
| 40 |
style="background-image: url('<?php echo esc_url(wp_get_attachment_url($slide['image_id'])); ?>');"> |
| 41 |
<div class="after-holder"> |
| 42 |
<div class="content-wrapper"> |
| 43 |
<div class="offer-tag ovheadtag-<?php echo esc_attr($post_id); ?>"> |
| 44 |
<?php echo esc_html($slide['head_tag']); ?> |
| 45 |
</div> |
| 46 |
<h1 class="heading title-<?php echo esc_attr($post_id); ?>"> |
| 47 |
<?php echo esc_html($slide['title']); ?> |
| 48 |
</h1> |
| 49 |
<div class="theme-para description-<?php echo esc_attr($post_id); ?>"> |
| 50 |
<?php echo esc_html($slide['description']); ?> |
| 51 |
</div> |
| 52 |
<div class="slide-number"> |
| 53 |
<?php echo esc_html(sprintf('%02d', $index + 1)); ?> |
| 54 |
</div> |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
</div> |
| 58 |
<?php endforeach; ?> |
| 59 |
</div> |
| 60 |
<div class="slider-swiper-button-nav"> |
| 61 |
<div class="swiper-button-next"></div> |
| 62 |
<div class="swiper-button-prev"></div> |
| 63 |
</div> |
| 64 |
|
| 65 |
<div class="swiper-pagination"></div> |
| 66 |
</div> |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
<div class="nav-wrapper"> |
| 71 |
<div class="triangle left" style="--r:3px;"></div> |
| 72 |
<!-- Thumbnails --> |
| 73 |
<div class="slider-nav"> |
| 74 |
<?php foreach ($slides as $index => $slide): ?> |
| 75 |
<div class="nav-item" data-index="<?php echo esc_attr($index); ?>"> |
| 76 |
<div class="item-img"> |
| 77 |
<?php |
| 78 |
$thumbnail_url = wp_get_attachment_url($slide['thumbnail_image_id']); |
| 79 |
if ($thumbnail_url): ?> |
| 80 |
<img src="<?php echo esc_url($thumbnail_url); ?>" |
| 81 |
alt="<?php echo esc_attr($slide['thumbnail_title']); ?>"> |
| 82 |
<?php endif; ?> |
| 83 |
</div> |
| 84 |
<div class="item-name ov-mini-thumb-titleimp"> |
| 85 |
<?php echo esc_html($slide['thumbnail_title']); ?> |
| 86 |
</div> |
| 87 |
</div> |
| 88 |
<?php endforeach; ?> |
| 89 |
</div> |
| 90 |
<div class="triangle right" style="--r:3px;"></div> |
| 91 |
</div> |
| 92 |
|
| 93 |
<div class="slider-counter"> |
| 94 |
<!-- Active slide count --> |
| 95 |
<span class="current-slide"> |
| 96 |
<?php echo sprintf('%02d', 1); // Example for current slide ?> |
| 97 |
</span>/ |
| 98 |
<!-- Total slide count --> |
| 99 |
<span class="total-slides"> |
| 100 |
<?php echo esc_html(sprintf('%02d', count($slides))); ?> |
| 101 |
</span> |
| 102 |
</div> |
| 103 |
</div> |
| 104 |
</div> |
| 105 |
</section> |