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

<?php $event_planning_management_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('event_planning_management_blog_slide_category'),
  'posts_per_page' => get_theme_mod('event_planning_management_blog_slide_number'),
); ?>

<div class="slider">
  <div class="owl-carousel">
    <?php $event_planning_management_arr_posts = new WP_Query( $event_planning_management_args );
    if ( $event_planning_management_arr_posts->have_posts() ) :
      while ( $event_planning_management_arr_posts->have_posts() ) :
        $event_planning_management_arr_posts->the_post();
        ?>
        <div class="blog_inner_box wow fadeInRight">
         <?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">
            <div class="blog_box_inner">
              <?php if ( get_theme_mod('event_planning_management_slider_text_extra') ) : ?>
                <p><?php echo esc_html(get_theme_mod('event_planning_management_slider_text_extra'));?></p>
              <?php endif; ?>
              <h3><?php the_title(); ?></h3>
              <p class="slider-button mt-4">
                <a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php esc_html_e('Contact Us','event-planning-management'); ?><i class="fas fa-long-arrow-alt-right ms-2"></i></a>
              </p>
            </div>
          </div>
        </div>
      <?php
    endwhile;
    wp_reset_postdata();
    endif; ?>
  </div>
</div>

<?php endif; ?>