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

<?php $ecommece_marketplace_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('ecommece_marketplace_blog_slide_category'),
  'posts_per_page' => get_theme_mod('ecommece_marketplace_blog_slide_number'),
); ?>

<?php $ecommece_marketplace_second_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('ecommece_marketplace_second_slide_category'),
  'posts_per_page' => get_theme_mod('ecommece_marketplace_second_slide_number'),
); ?>

<div class="slider">
  <div class="container-fluid">
    <div class="row">
      <div class="col-lg-8 col-md-8">
        <div class="owl-carousel">
          <?php $ecommece_marketplace_arr_posts = new WP_Query( $ecommece_marketplace_args );
          if ( $ecommece_marketplace_arr_posts->have_posts() ) :
            while ( $ecommece_marketplace_arr_posts->have_posts() ) :
              $ecommece_marketplace_arr_posts->the_post();
              ?>
              <div class="blog_inner_box wow fadeInLeft">
               <?php
                  if ( has_post_thumbnail() ) :
                    the_post_thumbnail();
                  else:
                    ?>
                    <div class="slider-alternate">
                      <img src="<?php echo get_stylesheet_directory_uri() . '/assets/images/banner.png'; ?>">
                    </div>
                    <?php
                  endif;
                ?>
                <div class="blog_box">
                  <div class="blog_box_inner wow fadeInRight">
                    <h3><a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php the_title(); ?></a></h3>
                    <p><?php echo wp_trim_words( get_the_content(), 20); ?></p>
                    <p class="slider-button mt-4">
                      <a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php esc_html_e('SHOP NOW','ecommece-marketplace'); ?></a>
                    </p>
                  </div>
                </div>
              </div>
            <?php
          endwhile;
          wp_reset_postdata();
          endif; ?>
        </div>
      </div>
      <div class="col-lg-4 col-md-4">
        <div class="second-slider">
          <div class="owl-carousel">
            <?php $ecommece_marketplace_second_arr_posts = new WP_Query( $ecommece_marketplace_second_args );
            if ( $ecommece_marketplace_second_arr_posts->have_posts() ) :
              while ( $ecommece_marketplace_second_arr_posts->have_posts() ) :
                $ecommece_marketplace_second_arr_posts->the_post();
                ?>
                <div class="blog_inner_box wow fadeInLeft">
                 <?php
                    if ( has_post_thumbnail() ) :
                      the_post_thumbnail();
                    else:
                      ?>
                      <div class="slider-alternate">
                        <img src="<?php echo get_stylesheet_directory_uri() . '/assets/images/banner.png'; ?>">
                      </div>
                      <?php
                    endif;
                  ?>
                  <div class="blog_box">
                    <div class="blog_box_inner">
                      <h3><a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php the_title(); ?></a></h3>
                      <p><?php echo wp_trim_words( get_the_content(), 10); ?></p>
                      <p class="slider-button mt-4">
                        <a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php esc_html_e('SHOP NOW','ecommece-marketplace'); ?></a>
                      </p>
                    </div>
                  </div>
                </div>
              <?php
            endwhile;
            wp_reset_postdata();
            endif; ?>
          </div>
        </div>
      </div>
    </div>
  </div>  
</div>

<?php endif; ?>