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

<?php 
$construction_services_company_args = array(
  'post_type'      => 'post',
  'post_status'    => 'publish',
  'category_name'  => get_theme_mod('construction_services_company_blog_slide_category'),
  'posts_per_page' => get_theme_mod('construction_services_company_blog_slide_number'),
  'orderby'        => 'date',
  'order'          => 'ASC'
); 
?>

<div class="slider">
  <div class="owl-carousel">
    <?php $construction_services_company_arr_posts = new WP_Query( $construction_services_company_args );
    if ( $construction_services_company_arr_posts->have_posts() ) :
      while ( $construction_services_company_arr_posts->have_posts() ) :
        $construction_services_company_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 pt-3 pt-md-0 wow zoomIn">
            <?php if ( get_theme_mod('construction_services_company_slider_extra_heading') ) : ?>
              <h5><?php echo esc_html(get_theme_mod('construction_services_company_slider_extra_heading'));?></h5>
            <?php endif; ?>
            <?php if ( get_theme_mod('construction_services_company_title_unable_disable',true) ) : ?>
              <h3 class="my-3"><?php the_title(); ?></a></h3>
            <?php endif; ?>
            <?php if ( get_theme_mod('construction_services_company_button_unable_disable',true) ) : ?>
              <p class="slider-button mt-4">
                <a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php esc_html_e('Know More','construction-services-company'); ?></a>
              </p>
            <?php endif; ?>
          </div>
        </div>
      <?php
    endwhile;
    wp_reset_postdata();
    endif; ?>
  </div>
</div>

<?php endif; ?>
