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

<?php $kids_fashion_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('kids_fashion_blog_slide_category'),
  'posts_per_page' => get_theme_mod('kids_fashion_blog_slide_number'),
); ?>

<div class="slider py-5">
  <div class="owl-carousel">
    <?php $kids_fashion_arr_posts = new WP_Query( $kids_fashion_args );
    if ( $kids_fashion_arr_posts->have_posts() ) :
      while ( $kids_fashion_arr_posts->have_posts() ) :
        $kids_fashion_arr_posts->the_post();
        ?>
        <div class="container">
          <div class="row">
            <div class="col-lg-7 col-md-7 col-sm-6 align-self-center blog_box_order wow zoomIn">
              <div class="blog_box pt-3 pt-md-0">
                <?php if ( get_theme_mod('kids_fashion_slider_main_title', true) == true ) : ?>
                  <h2><?php echo esc_html( get_theme_mod('kids_fashion_slider_main_title' ) ); ?></h2>
                <?php endif; ?>
                <?php if ( get_theme_mod('kids_fashion_slide_title_unable_disable', true) == true ) : ?>
                  <h3 class="my-3"><a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php the_title(); ?></a></h3>
                <?php endif; ?>
                <?php if ( get_theme_mod('kids_fashion_slide_text_unable_disable', true) == true ) : ?>
                  <p class="slider-text"><?php echo wp_trim_words( get_the_content(), get_theme_mod('kids_fashion_slide_excerpt_number',20) ); ?></p>
                <?php endif; ?>
                <?php if ( get_theme_mod('kids_fashion_slider_button_text', true) == true ) : ?>
                  <p class="slider_btn my-5">
                    <a href="<?php the_permalink(); ?>" class="py-3 px-4"><?php echo esc_html( get_theme_mod('kids_fashion_slider_button_text' ) ); ?></a>
                  </p>
                <?php endif; ?>
              </div>
            </div>
            <div class="col-lg-5 col-md-5 col-sm-6 align-self-center blog_inner_box_order">
              <div class="blog_inner_box">
                <?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>
            </div>
          </div>
        </div>
      <?php
    endwhile;
    wp_reset_postdata();
    endif; ?>
  </div>
</div>

<?php endif; ?>
