<?php $job_listing_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('job_listing_blog_slide_category'),
  'posts_per_page' => get_theme_mod('job_listing_blog_slide_number'),
); ?>

<?php if ( get_theme_mod('job_listing_blog_box_enable',true) ) : ?>
  <div class="slider">
    <div class="slider-box">
      <div class="slider-inner-banner">
          <div class="owl-carousel">
            <?php $job_listing_arr_posts = new WP_Query( $job_listing_args );
            $i = 1;
            if ( $job_listing_arr_posts->have_posts() ) :
              while ( $job_listing_arr_posts->have_posts() ) :
                $job_listing_arr_posts->the_post();
                ?>
                <div class="slider-box">
                  <div class="slider-image">
                    <?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>
                  <div class="slider-owl-position">
                    <h3 class="mb-3"><?php the_title(); ?></h3>
                    <p class="mb-4 pb-2 content"><?php echo wp_trim_words(get_the_content(), 30); ?></p>
                    <?php if(get_theme_mod('job_listing_contact_form_shortcode')){ ?>
                      <div class="form-box">
                        <?php echo do_shortcode(get_theme_mod('job_listing_contact_form_shortcode')); ?>
                      </div>
                    <?php }?>
                  </div>
                </div>
              <?php
              $i++;
            endwhile;
            wp_reset_postdata();
            endif; ?>
          </div>
      </div>
    </div>
  </div>
<?php endif; ?>