<?php 
/**
 * Template part for displaying Featured Slider Section
 *
 *@package Business Carter
 */

    $business_carter_number_of_featured_slider_items         = business_carter_get_option( 'business_carter_number_of_featured_slider_items' ); ?>

    <div class="section-content" data-slick='{"slidesToShow": 1, "slidesToScroll": 1, "infinite": false, "speed": 1000, "dots": true, "arrows": true, "autoplay": false, "draggable": true, "fade": false }'>

        <?php for( $i=1; $i<=$business_carter_number_of_featured_slider_items; $i++ ) : 
            $business_carter_featured_slider_slide_image[$i]            = business_carter_get_option( 'business_carter_featured_slider_slide_image_'.$i );

            $business_carter_featured_slider_subtitle[$i]               = business_carter_get_option( 'business_carter_featured_slider_subtitle_'.$i );

            $business_carter_featured_slider_title[$i]                  = business_carter_get_option( 'business_carter_featured_slider_title_'.$i );

            $business_carter_featured_slider_btn_text_one[$i]           = business_carter_get_option( 'business_carter_featured_slider_btn_text_one_'.$i );

            $business_carter_featured_slider_btn_url_one[$i]            = business_carter_get_option( 'business_carter_featured_slider_btn_url_one_'.$i );     
        ?>

        <article class="<?php echo esc_attr($class); ?>" style="background-image: url('<?php echo esc_url( $business_carter_featured_slider_slide_image[$i] ); ?>');">
            <div class="overlay"></div>
            <div class="wrapper">
                <div class="featured-content-wrapper">
                    <?php if( !empty($business_carter_featured_slider_subtitle[$i]) || !empty($business_carter_featured_slider_title[$i]) ): ?>
                        <header class="entry-header">
                            <?php if( !empty($business_carter_featured_slider_subtitle[$i]) ): ?>
                                <h3 class="entry-subtitle"><?php echo esc_html($business_carter_featured_slider_subtitle[$i]); ?></h3>
                            <?php endif; ?>

                            <?php if( !empty($business_carter_featured_slider_title[$i]) ): ?>
                                <h2 class="entry-title"><?php echo esc_html( $business_carter_featured_slider_title[$i] ); ?></h2>
                            <?php endif; ?>
                        </header>
                    <?php endif; ?>

                    <?php if( !empty($business_carter_featured_slider_btn_text_one[$i]) ): ?>
                        <div class="read-more">
                            <?php if( !empty($business_carter_featured_slider_btn_text_one[$i]) ): ?>
                                <a href="<?php echo esc_attr($business_carter_featured_slider_btn_url_one[$i]);?>" class="btn"><?php echo esc_html($business_carter_featured_slider_btn_text_one[$i]);?><i class="fas fa-long-arrow-alt-right"></i></a>
                            <?php endif; ?>
                        </div><!-- .read-more -->
                    <?php endif; ?>
                </div><!-- .featured-content-wrapper -->
            </div><!-- .wrapper -->
        </article>
        <?php endfor; ?>
    </div><!-- .section-content -->