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

get_header(); ?>

<main id="maincontent" role="main">
  <?php do_action( 'accommodation_rental_before_slider' ); ?>
    <?php if(get_theme_mod( 'accommodation_rental_slider_hide_show', false) == 1 || get_theme_mod( 'accommodation_rental_resp_slider_hide_show', true) == 1) { ?>
      <section id="slider-sec" class="wow slideInLeft delay-1000" data-wow-duration="2s">  
        <?php if(get_theme_mod('accommodation_rental_slider_type', 'Default slider') == 'Default slider' ){ ?>
          <div class="owl-carousel">
              <?php
              $accommodation_rental_catData = get_theme_mod('accommodation_rental_category');
              if($accommodation_rental_catData){
                $page_query = new WP_Query(array( 'category_name' => esc_html( $accommodation_rental_catData ,'accommodation-rental')));
                while( $page_query->have_posts() ) : $page_query->the_post(); ?>
                  <?php if(has_post_thumbnail()) {?>
                    <div class="box mb-4 wow zoomIn" data-wow-duration="2s">
                      <div class="bx-image"><?php the_post_thumbnail(); ?></div>
                      <div class="slider-inner-content">
                        <?php if( get_theme_mod('accommodation_rental_small_slider_text') != '' ){ ?>
                          <span class="d-block mb-1"><?php echo esc_html(get_theme_mod('accommodation_rental_small_slider_text',''));?>
                          <span class="shape right">
                            <span class="dots"></span>
                          </span>
                        </span>
                        <?php }?>
                        <h1 class="mt-3"><?php the_title();?></h1>
                        <p class="wow slideInLeft delay-1000" data-wow-duration="2s"><?php $accommodation_rental_excerpt = get_the_excerpt(); echo esc_html( accommodation_rental_string_limit_words( $accommodation_rental_excerpt, esc_attr(get_theme_mod('accommodation_rental_slider_excerpt_number','15')))); ?></p>
                        <?php
                          $accommodation_rental_button_text = get_theme_mod('accommodation_rental_slider_button_text','Book Your Stay');
                          $accommodation_rental_button_link = get_theme_mod('accommodation_rental_top_button_url', '');
                          if (empty($accommodation_rental_button_link)) {
                            $accommodation_rental_button_link = get_permalink();
                          }
                          if ($accommodation_rental_button_text || !empty($accommodation_rental_button_link)) { ?>
                          <div class="slider-btn my-4 pb-4">
                            <?php if( get_theme_mod('accommodation_rental_slider_button_text','Book Your Stay') != ''){ ?>
                              <a href="<?php echo esc_url($accommodation_rental_button_link); ?>" class="button redmor">
                              <?php echo esc_html($accommodation_rental_button_text); ?>
                                <span class="screen-reader-text"><?php echo esc_html($accommodation_rental_button_text); ?></span>
                              </a>
                            <?php } ?>
                          </div>
                        <?php } ?>
                      </div>
                    </div>
                  <?php }?>
                <?php endwhile;
                wp_reset_postdata();
              } ?>
            </div>
            <?php if(get_theme_mod( 'accommodation_rental_slider_form_hide_show_text', false) != '') { ?>
              <div class="form-sec-slider">
                <?php echo do_shortcode(get_theme_mod('accommodation_rental_advance_slider_form_shortcode')); ?>
              </div>
            <?php }?>
          </div>
          <?php } else if(get_theme_mod('accommodation_rental_slider_type', 'Advance slider') == 'Advance slider'){?>
            <?php echo do_shortcode(get_theme_mod('accommodation_rental_advance_slider_shortcode')); ?>
          <?php } ?>
      </section>
    <?php }?>

  <?php do_action( 'accommodation_rental_after_slider' ); ?>

<!-- house villa Section -->
  <?php if( get_theme_mod( 'accommodation_rental_house_villa_heading')|| get_theme_mod( 'accommodation_rental_house_villa_small_title') || get_theme_mod( 'accommodation_rental_house_villa_category')) { ?>
    <section id="house-villa-section" class="wow bounceInDown delay-1000 container" data-wow-duration="3s">
      <div class="container"> 
        <?php if( get_theme_mod('accommodation_rental_house_villa_small_title') != '' ){ ?>
          <p class="small-text text-center"><?php echo esc_html(get_theme_mod('accommodation_rental_house_villa_small_title',''));?></p>
        <?php }?>
        <?php if( get_theme_mod('accommodation_rental_house_villa_heading') != '' ){ ?>
          <h3 class="heading-text text-center"><?php echo esc_html(get_theme_mod('accommodation_rental_house_villa_heading',''));?></h3>
        <?php }?>
        <div class="house-villa-category-sec">
          <?php echo do_shortcode(get_theme_mod('accommodation_rental_advance_featured_villa_shortcode')); ?>
        </div>
      </div>
    </section>
  <?php }?>
<?php do_action( 'accommodation_rental_after_house_villa_section' ); ?>

  <div id="content-vw" class="entry-content py-3">
    <div class="container">
      <?php while ( have_posts() ) : the_post(); ?>
        <?php the_content(); ?>
      <?php endwhile; // end of the loop. ?>
    </div>
  </div>
</main>

<?php get_footer(); ?>