| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/vhost/cosmicindrani.com/wp-content/themes/indrani/template-parts/ |
Upload File : |
<?php
$heroslider = get_posts(array(
'post_type' => 'heroslider',
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 300
));
if (!empty($heroslider)) : // Only display the slider section if there are posts
?>
<section class="sliderSec">
<div id="contentSlider" class="carousel slide" data-bs-ride="carousel">
<!-- Indicators -->
<div class="carousel-indicators">
<?php
foreach ($heroslider as $key => $herosliderListVal) {
?>
<button type="button" data-bs-target="#contentSlider" data-bs-slide-to="<?php echo esc_attr($key); ?>" class="<?php echo $key === 0 ? 'active' : ''; ?>" aria-current="<?php echo $key === 0 ? 'true' : 'false'; ?>" aria-label="Slide <?php echo esc_attr($key + 1); ?>"></button>
<?php
}
?>
</div>
<!-- Slides -->
<div class="carousel-inner">
<?php
$i = 0;
foreach ($heroslider as $herosliderListVal) {
$featuredImage = get_the_post_thumbnail_url($herosliderListVal->ID, 'full');
?>
<div class="carousel-item <?php echo $i === 0 ? 'active' : ''; ?>">
<div class="container container1600">
<div class="row flex-sm-row-reverse align-items-center">
<div class="col-md-5">
<div class="rgtSec">
<img src="<?php echo esc_url($featuredImage); ?>" alt="<?php echo esc_attr(get_the_title($herosliderListVal->ID)); ?>" class="img-fluid">
</div>
</div>
<div class="col-md-7">
<div class="lftSec">
<h3><?php echo get_field("sub_title", $herosliderListVal->ID); ?></h3>
<h2><?php echo get_the_title($herosliderListVal->ID); ?></h2>
<p><?php echo get_the_content(null, false, $herosliderListVal->ID); ?></p>
<a class="btn btnRed" href="<?php echo esc_url(get_field("button_url", $herosliderListVal->ID)); ?>">
<?php echo get_field("button_name", $herosliderListVal->ID); ?>
</a>
</div>
</div>
</div>
</div>
</div>
<?php
$i++;
}
?>
</div>
</div>
</section>
<?php
endif; // End of check for non-empty $heroslider
?>