<?php $automobile_rental_args = array(
  'post_type' => 'post',
  'post_status' => 'publish',
  'category_name' =>  get_theme_mod('automobile_rental_blog_categories_section_category'),
  'posts_per_page' => get_theme_mod('automobile_rental_blog_categories_section_number'),
); ?>

<?php if ( get_theme_mod('automobile_rental_testimonial_section_enable',true) ) : ?>
	<div id="trending" class="pt-5 wow fadeInUp">
		<div class="container">
			<div class="categories-box">
				<div class="categories-heading">
					<h4 class="mb-4"><?php echo esc_html(get_theme_mod('automobile_rental_categories_section_heading'));?></h4>
					<h5 class="mb-4"><?php echo esc_html(get_theme_mod('automobile_rental_categories_section_one_word'));?></h5>
				</div>
				<div class="cat-box">
					<div class="row ser-box mb-4">
						<div class="owl-carousel">
				        <?php $automobile_rental_arr_posts = new WP_Query( $automobile_rental_args );
				            $i = 1;
				            if ( $automobile_rental_arr_posts->have_posts() ) :
				              while ( $automobile_rental_arr_posts->have_posts() ) :
				                $automobile_rental_arr_posts->the_post();
				                ?>
				                <div class="rental-box mb-4">
				                  	<div class="rental-image">
					                    <?php
					                      if ( has_post_thumbnail() ) :
					                        the_post_thumbnail();
					                      else:
					                        ?>
					                        <div class="rental-alternate">
					                          <img src="<?php echo get_stylesheet_directory_uri() . '/assets/images/banner.png'; ?>">
					                        </div>
					                        <?php
					                      endif;
					                    ?>
				                  	</div>
				                  	<div class="rental-owl-position">
				                    	<h3 class="mb-3"><?php the_title(); ?></h3>
				                  	</div>
				                 	<div class="rental-button mb-0">
			                      		<a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><i class="fas fa-arrow-right"></i></a>
			                    	</div>
				                </div>
				              <?php
				              $i++;
				            endwhile;
				            wp_reset_postdata();
				            endif; ?>
				        </div>
				    </div>
			    </div>
			</div>
		</div>
	</div>
<?php endif; ?>