<?php if ( get_theme_mod('data_analytics_center_blog_box_enable',false) ) : ?>

<?php $data_analytics_center_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('data_analytics_center_blog_slide_category'),
  'posts_per_page' => get_theme_mod('data_analytics_center_blog_slide_number'),
); ?>

<div class="slider pb-5">
  <div class="slider-inner-banner">
    <div class="clip-path-slider"></div>
    <?php if ( get_theme_mod('data_analytics_center_slider_banner_image') ) : ?>
      <img class="inner-banner" src="<?php echo esc_url(get_theme_mod('data_analytics_center_slider_banner_image'));?>">
    <?php else: ?>
      <div class="slider-alternate">
        <img src="<?php echo get_stylesheet_directory_uri() . '/assets/images/banner-slide.png'; ?>">
      </div>
    <?php endif; ?>
    <div class="owl-carousel slider-owl-position">
      <?php $data_analytics_center_arr_posts = new WP_Query( $data_analytics_center_args );
      if ( $data_analytics_center_arr_posts->have_posts() ) :
        while ( $data_analytics_center_arr_posts->have_posts() ) :
          $data_analytics_center_arr_posts->the_post();
          ?>
          <div class="container">
            <div class="row">
              <div class="col-lg-7 col-md-6 align-self-center">
                <div class="blog_box_inner wow fadeInRight">
                  <h3><?php the_title(); ?></h3>
                  <p><?php echo wp_trim_words(get_the_content(), 25); ?></p>
                  <div class="button-section mt-5">
                    <p class="slider-button mb-0">
                      <a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php esc_html_e('Learn More','data-analytics-center'); ?></a>
                    </p>
                    <?php if ( get_theme_mod('data_analytics_center_slider_video_url') ) : ?>
                      <p class="video-button mb-0">
                        <a href="<?php echo esc_url(get_theme_mod('data_analytics_center_slider_video_url'));?>"><i class="fas fa-play me-3"></i><?php esc_html_e('Watch Video','data-analytics-center'); ?></a>
                      </p>
                    <?php endif; ?>
                  </div>
                </div>
              </div>
              <div class="col-lg-5 col-md-6 align-self-center">
                <div class="blog_inner_box wow fadeInUp">
                  <?php
                    if ( has_post_thumbnail() ) :
                      the_post_thumbnail();
                    else:
                      ?>
                      <div class="slider-alternate">
                        <img src="<?php echo get_stylesheet_directory_uri() . '/assets/images/slider.png'; ?>">
                      </div>
                      <?php
                    endif;
                  ?>
                </div>
              </div>
            </div>
          </div>
        <?php
      endwhile;
      wp_reset_postdata();
      endif; ?>
    </div>
  </div>
</div>

<?php endif; ?>