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

<?php $professional_blogger_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('professional_blogger_blog_slide_category'),
  'posts_per_page' => get_theme_mod('professional_blogger_blog_slide_number'),
); ?>

<div class="slider pt-5">
  <div class="container">
    <div class="owl-carousel">
      <?php $professional_blogger_arr_posts = new WP_Query( $professional_blogger_args );
      if ( $professional_blogger_arr_posts->have_posts() ) :
        while ( $professional_blogger_arr_posts->have_posts() ) :
          $professional_blogger_arr_posts->the_post();
          ?>
          <div class="blog_inner_box wow fadeInRight">
           <?php
            if ( has_post_thumbnail() ) :
              the_post_thumbnail();
            else:
              ?>
              <div class="blog_inner_box">
                <img src="<?php echo get_stylesheet_directory_uri() . '/assets/images/banner.png'; ?>">
              </div>
              <?php
            endif;
          ?>
            <div class="blog_box">
              <?php the_category(); ?>
              <h3><a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php the_title(); ?></a></h3>
              <p class="mb-0"><?php echo wp_trim_words( get_the_content(), 25 ); ?></p>
            </div>
          </div>
        <?php
      endwhile;
      wp_reset_postdata();
      endif; ?>
    </div>
  </div>
</div>

<?php endif; ?>