<?php 
$vegan_cafe_restaurant_slider = get_theme_mod('vegan_cafe_restaurant_slider_setting', false);

if ($vegan_cafe_restaurant_slider == '1') :
?>
<section id="slider">
    <div id="owl-carousel" class="owl-carousel">
        <?php
        $vegan_cafe_restaurant_slide_pages = array();
        for ($vegan_cafe_restaurant_count = 1; $vegan_cafe_restaurant_count <= 4; $vegan_cafe_restaurant_count++) {
            $vegan_cafe_restaurant_mod = intval(get_theme_mod('vegan_cafe_restaurant_slider_page' . $vegan_cafe_restaurant_count));
            if ('page-none-selected' !== $vegan_cafe_restaurant_mod && $vegan_cafe_restaurant_mod > 0) {
                $vegan_cafe_restaurant_slide_pages[] = $vegan_cafe_restaurant_mod;
            }
        }
        if (!empty($vegan_cafe_restaurant_slide_pages)) :
            $vegan_cafe_restaurant_args = array(
                'post_type' => 'page',
                'post__in' => $vegan_cafe_restaurant_slide_pages,
                'orderby' => 'post__in'
            );
            $vegan_cafe_restaurant_query = new WP_Query($vegan_cafe_restaurant_args);
            if ($vegan_cafe_restaurant_query->have_posts()) :
                while ($vegan_cafe_restaurant_query->have_posts()) : $vegan_cafe_restaurant_query->the_post(); ?>
                    <div class="item">
                        <?php if (has_post_thumbnail()) { ?>
                            <img src="<?php echo esc_url(get_the_post_thumbnail_url(get_the_ID(), 'full')); ?>" alt="<?php echo esc_attr(get_the_title()); ?>" />
                        <?php } else { ?>
                            <div class="slider-color-box"></div>
                        <?php } ?>
                        <div class="container">
                            <div class="carousel-caption">
                                <div class="inner_carousel wow fadeInUp" data-wow-delay="0.5s">
                                    <?php if (get_theme_mod('vegan_cafe_restaurant_slider_short_heading') != '') { ?>
                                        <p class="slidetop-text mb-2"><?php echo esc_html(get_theme_mod('vegan_cafe_restaurant_slider_short_heading', '')); ?></p>
                                    <?php } ?>
                                    <h1 class="custom-title mb-2">
                                      <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                                    </h1>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php endwhile;
                wp_reset_postdata(); ?>
            <?php else : ?>
                <div class="no-postfound"></div>
            <?php endif;
        endif; ?>
    </div>
</section>
<?php endif; ?>

<?php 
    $vegan_cafe_restaurant_banner_form_shortcode = get_theme_mod('vegan_cafe_restaurant_banner_form_shortcode', '');
    if (!empty($vegan_cafe_restaurant_banner_form_shortcode)) { ?>
    <div class="table-book-form">
        <div class="container wow zoomIn" data-wow-delay="0.5s">
            <?php echo do_shortcode(get_theme_mod('vegan_cafe_restaurant_banner_form_shortcode')); ?>
        </div>
    </div>
<?php }?> 
