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

<?php $movie_review_blog_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('movie_review_blog_blog_slide_category'),
  'posts_per_page' => get_theme_mod('movie_review_blog_blog_slide_number'),
  'order' => 'ASC',
  'orderby' => 'title'
); ?>

<div class="slider pb-5">
  <div class="owl-carousel">
    <?php $movie_review_blog_arr_posts = new WP_Query( $movie_review_blog_args );
    if ( $movie_review_blog_arr_posts->have_posts() ) :
      while ( $movie_review_blog_arr_posts->have_posts() ) :
        $movie_review_blog_arr_posts->the_post();
        ?>          
        <div class="blog_inner_box  wow fadeInLeft">
          <div class="clip-path-slider"></div>
          <?php
            if ( has_post_thumbnail() ) :
              the_post_thumbnail();
            else:
              ?>
              <div class="slider-alternate">
                <img src="<?php echo get_stylesheet_directory_uri() . '/assets/images/slider.png'; ?>">
              </div>
              <?php
            endif;
          ?>
          <div class="blog_box_inner">
            <h3><?php the_title(); ?></h3>
            <p><?php echo wp_trim_words(get_the_content(), 25); ?></p>
            <p class="slider-button mt-4">
              <a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php esc_html_e('Sign Up Now','movie-review-blog'); ?></a>
            </p>
          </div>
        </div>
      <?php
    endwhile;
    wp_reset_postdata();
    endif; ?>
  </div>
  <div class="clip-path-down"></div>
</div>

<?php endif; ?>