<?php
/**
 * Template Name: Home Template
 */

get_header(); ?>

<main id="skip-content">
  <?php if (get_theme_mod('holiday_travel_cruise_banner_section_setting', false) != '') { ?>
    <section id="top-banner">
      <div class="banner-box">
        <div class="container">
          <div class="row">
            <div class="col-lg-6 col-md-6 align-self-center">
              <div class="banner-inner-box">
                <?php if(get_theme_mod('holiday_travel_cruise_banner_heading') != ''){ ?>
                  <h2 class=""><?php echo esc_html(get_theme_mod('holiday_travel_cruise_banner_heading')); ?></h2>
                <?php }?>
                <div class="slide-btn mt-lg-4 mt-4">
                  <?php if(get_theme_mod('holiday_travel_cruise_banner_button_text1') != '' || get_theme_mod('holiday_travel_cruise_banner_button_url1') != ''){ ?>
                    <a href="<?php echo esc_url(get_theme_mod('holiday_travel_cruise_banner_button_url1')); ?>" class="banner-btn1"><?php echo esc_html(get_theme_mod('holiday_travel_cruise_banner_button_text1')); ?></a>
                  <?php }?>
                </div>
              </div>
            </div>
            <div class="col-lg-6 col-md-6">
              <div class="banner-right">
                <?php if(get_theme_mod('holiday_travel_cruise_banner_content') != ''){ ?>
                  <p class=""><?php echo esc_html(get_theme_mod('holiday_travel_cruise_banner_content')); ?></p>
                <?php }?>
                <div class="video-btn text-md-end text-center mt-5">
                  <?php if(get_theme_mod('holiday_travel_cruise_banner_video_btn_url') != ''){ ?>
                    <a href="<?php echo esc_url(get_theme_mod('holiday_travel_cruise_banner_video_btn_url')); ?>" target="_blank"><?php echo esc_html('Live Demo', 'holiday-travel-cruise'); ?><i class="fas fa-play ms-3"></i></a>
                  <?php }?>
                </div>
              </div>
            </div>
          </div>
          <div class="banner-inner text-center">
            <?php if(get_theme_mod('holiday_travel_cruise_banner_image') != ''){ ?>
              <img src="<?php echo esc_url(get_theme_mod('holiday_travel_cruise_banner_image')); ?>" class="banner-img" alt="" />
            <?php } else{?>
              <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/img/banner-img.png" class="banner-img" alt="" />
            <?php } ?>
          </div>
          <div class="contact-section mt-5">
            <?php if(get_theme_mod('holiday_travel_cruise_contact_heading') != ''){ ?>
              <h5 class="mb-4"><?php echo esc_html(get_theme_mod('holiday_travel_cruise_contact_heading')); ?></h5>
            <?php }?>
            <?php if(get_theme_mod('holiday_travel_cruise_contact_form_Shortcode') != ''){ ?>
              <?php echo do_shortcode(get_theme_mod('holiday_travel_cruise_contact_form_Shortcode')); ?>
            <?php }?>
          </div>
        </div>
      </div>
    </section>
  <?php }?>

  <?php if (get_theme_mod('holiday_travel_cruise_bestcruise_section_setting', false) != '') { ?>
    <section id="bestcruise-section" class="py-5">
      <div class="container">
        <div class="bestcruise-mainbox">
          <div class="bestcruise-head mb-3 py-3 text-center">
            <?php if(get_theme_mod('holiday_travel_cruise_bestcruise_sub_heading') != ''){ ?>
              <h6 class=""><?php echo esc_html(get_theme_mod('holiday_travel_cruise_bestcruise_sub_heading')); ?></h6>
            <?php }?>
            <?php if(get_theme_mod('holiday_travel_cruise_bestcruise_heading') != ''){ ?>
              <h3 class="main-heading mb-4"><?php echo esc_html(get_theme_mod('holiday_travel_cruise_bestcruise_heading')); ?></h3>
            <?php }?>
          </div>
          <div class="row">
            <?php
              $holiday_travel_cruise_bestcruise_category = get_theme_mod('holiday_travel_cruise_bestcruise_category','');
              if($holiday_travel_cruise_bestcruise_category){
                $holiday_travel_cruise_page_query5 = new WP_Query(array( 'category_name' => esc_html($holiday_travel_cruise_bestcruise_category,'holiday-travel-cruise'), 'posts_per_page' => esc_attr(get_theme_mod('holiday_travel_cruise_bestcruise_number',4))));
                $i=1;
                while( $holiday_travel_cruise_page_query5->have_posts() ) : $holiday_travel_cruise_page_query5->the_post(); ?>
                  <div class="col-lg-3 col-md-6">
                    <div class="bestcruise-box">
                      <?php if(get_theme_mod('holiday_travel_cruise_bestcruise_icon'.$i) != ''){ ?>
                        <div class="bestcruise-icon">
                          <i class="<?php echo esc_html(get_theme_mod('holiday_travel_cruise_bestcruise_icon'.$i)); ?>"></i>
                        </div>
                      <?php }?>
                      <div class="bestcruise-content">
                        <h4><a href="<?php the_permalink(); ?>"><?php echo wp_trim_words(get_the_title(), 8, '...'); ?></a></h4>
                        <p><?php echo wp_trim_words( get_the_content(), 15); ?></p>
                        <a href="<?php the_permalink(); ?>" target="_blank" class="read-btn"><?php echo esc_html('Submit Now', 'holiday-travel-cruise'); ?></a>
                      </div>
                    </div>
                  </div>
                <?php $i++; endwhile;
              wp_reset_postdata();
            } ?>
          </div>
        </div>
      </div>
    </section>
  <?php }?>
  <section id="page-content">
    <div class="container">
      <?php if ( have_posts() ) {?>
        <div class="py-5">
          <?php while ( have_posts() ) : the_post();
            the_content();
          endwhile; ?>
        </div>
      <?php }?>
    </div>
  </section>
</main>

<?php get_footer(); ?>