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

    $number_of_featured_slider_items         = business_element_get_option( 'number_of_featured_slider_items' ); ?>

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

        <?php for( $i=1; $i<=$number_of_featured_slider_items; $i++ ) : 
            $featured_slider_slide_image[$i]            = business_element_get_option( 'featured_slider_slide_image_'.$i );

            $featured_slider_subtitle[$i]               = business_element_get_option( 'featured_slider_subtitle_'.$i );

            $featured_slider_title[$i]                  = business_element_get_option( 'featured_slider_title_'.$i );

            $featured_slider_content[$i]                = business_element_get_option( 'featured_slider_content_'.$i );

            $featured_slider_btn_text_one[$i]           = business_element_get_option( 'featured_slider_btn_text_one_'.$i );

            $featured_slider_btn_url_one[$i]            = business_element_get_option( 'featured_slider_btn_url_one_'.$i );     
        ?>

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

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

                    <?php if( !empty($featured_slider_content[$i]) ): ?>

                        <div class="entry-content">
                            <?php echo esc_html( $featured_slider_content[$i] ); ?>
                        </div><!-- .entry-content -->

                    <?php endif; ?>

                    <?php if( !empty($featured_slider_btn_text_one[$i]) ): ?>
                        <div class="read-more">
                            <?php if( !empty($featured_slider_btn_text_one[$i]) ): ?>
                                <a href="<?php echo esc_attr($featured_slider_btn_url_one[$i]);?>" class="btn"><?php echo esc_html($featured_slider_btn_text_one[$i]);?></a>
                            <?php endif; ?>
                        </div><!-- .read-more -->
                    <?php endif; ?>
                </div><!-- .featured-content-wrapper -->
            </div><!-- .wrapper -->
        </article>
        <?php endfor; ?>
    </div><!-- .section-content -->