<?php global $post;
$is_first = get_query_var('is_first'); // Initialize a variable to track the first item
?>
<div class="carousel-item <?php echo $is_first ? 'active' : ''; ?> h-100 banner-slider" style="background: #000">
    <?php if (has_post_thumbnail($post->ID)) :
        $imageInfo = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail');
        $imageUrl = $imageInfo[0]; ?>

        <img src="<?php echo $imageUrl ?>" class="d-block w-100 h-100 object-cover" alt="...">
    <?php
    else:
        ?>
        <img src="<?php echo esc_url(get_template_directory_uri()); ?>/public/upload/slider/20231011_1696995712866.jpg"
             class="d-block w-100 h-100 object-cover" alt="...">
    <?php
    endif;
    ?>
    <?php
    $content = get_the_content();

    if (!empty($content)) {
        echo '<div class="carousel-caption d-none d-md-inline-block rounded shadow">' .
            apply_filters('the_content', $content) .
            '</div>';
    }
    ?>

</div>