<?php if ( true == get_theme_mod( 'flight_booking_news_feed_on_off', 'off' ) ) : ?>

<?php 

$flight_booking_news_feed_main_heading = get_theme_mod('flight_booking_news_feed_main_heading');

?>

<section id="home_news_feed" class="py-5">
  <div class="container">
    <?php if ( ! empty( $flight_booking_news_feed_main_heading ) ): ?>
      <h3 class="text-center wow fadeInDown" data-wow-duration="2s"><?php echo esc_html( $flight_booking_news_feed_main_heading ); ?>
      <hr class="mb-5">
      </h3>
    <?php endif; ?>
    <?php $flight_booking_args = array(
      'post_type' => 'post',
      'post_status' => 'publish',
      'category_name' =>  get_theme_mod('flight_booking_services_category'),
      'posts_per_page' => 7,
    ); ?>
    <div class="row">
      <?php $flight_booking_arr_posts = new WP_Query( $flight_booking_args );
        if ( $flight_booking_arr_posts->have_posts() ) :
        while ( $flight_booking_arr_posts->have_posts() ) :
        $flight_booking_arr_posts->the_post();
        ?>
        <div class="col-lg-3 col-md-6 col-sm-6">
          <div class="services_inner_box mb-5 wow fadeInUp" data-wow-duration="2s">
            <?php if ( has_post_thumbnail() ) : ?>
                <?php the_post_thumbnail(); ?>
            <?php else : ?>
                <img src='<?php echo esc_url(get_template_directory_uri()); ?>/images/exist_img.png'>
            <?php endif; ?>
            <div class="service_content_box">
              <h4><a href="<?php echo esc_url(get_permalink($post->ID)); ?>"><?php the_title(); ?></a></h4>
              <p><?php echo wp_trim_words( get_the_content(), 15 ); ?></p>
              <div class="post-meta">
                <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' )) ); ?>"><i class="fa fa-user me-2" aria-hidden="true"></i> <?php the_author(); ?></a>
                <span><i class="fa fa-comment me-2" aria-hidden="true"></i> <?php comments_number( esc_attr('0', 'flight-booking'), esc_attr('0', 'flight-booking'), esc_attr('%', 'flight-booking') ); ?> <?php esc_html_e('comments','flight-booking'); ?></span>
              </div>
            </div>
          </div>
        </div>
        <?php
      endwhile;
      wp_reset_postdata();
      endif; ?>
    </div>
  </div>
</section>

<?php endif; ?>