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

<?php $web_hosting_lite_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('web_hosting_lite_blog_slide_category'),
  'posts_per_page' => get_theme_mod('web_hosting_lite_blog_slide_number'),
); ?>

<div class="slider">
  <div class="owl-carousel">
    <?php $web_hosting_lite_arr_posts = new WP_Query( $web_hosting_lite_args );
    if ( $web_hosting_lite_arr_posts->have_posts() ) :
      while ( $web_hosting_lite_arr_posts->have_posts() ) :
        $web_hosting_lite_arr_posts->the_post();
        ?>
        <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 class="blog_box wow zoomIn">
            <?php if ( get_theme_mod('web_hosting_lite_slider_extra_heading') ) : ?>
              <h6><?php echo esc_html(get_theme_mod('web_hosting_lite_slider_extra_heading')); ?></h6>
            <?php endif; ?>
            <?php if ( get_theme_mod('web_hosting_lite_title_unable_disable',true) ) : ?>
              <h3 class="my-3"><?php the_title(); ?></a></h3>
            <?php endif; ?>
            <?php if ( get_theme_mod('web_hosting_lite_text_unable_disable',true) ) : ?>
              <p class="mt-2"><?php echo wp_trim_words( get_the_content(), 20 ); ?></p>
            <?php endif; ?>
            <?php if ( get_theme_mod('web_hosting_lite_slider_search_unable_disable',true) ) : ?>
            <div class="searchbox">
              <?php get_search_form(); ?>
            </div>
            <?php endif; ?>
          </div>
        </div>
      <?php
    endwhile;
    wp_reset_postdata();
    endif; ?>
  </div>
</div>

<?php endif; ?>
