<?php
/**
 * Template part for displaying about section
 *
 * @package Luxury Hotels
 * @subpackage luxury_hotels
 */

?>
<?php $luxury_hotels_static_image = get_template_directory_uri() . '/assets/images/about_img.png'; ?>
<?php if( get_theme_mod( 'luxury_hotels_about_show_hide', true) != '') { ?>
<section id="about">
  <div class="container">
    <div class="row">
      <?php $luxury_hotels_about_page = array();
        $luxury_hotels_mod = absint( get_theme_mod( 'luxury_hotels_about_page' ));
        if ( 'page-none-selected' != $luxury_hotels_mod ) {
          $luxury_hotels_about_page[] = $luxury_hotels_mod;
        }
      if( !empty($luxury_hotels_about_page) ) :
        $luxury_hotels_args = array(
          'post_type' => 'page',
          'post__in' => $luxury_hotels_about_page,
          'orderby' => 'post__in'
        );
        $luxury_hotels_query = new WP_Query( $luxury_hotels_args );
        if ( $luxury_hotels_query->have_posts() ) :
          while ( $luxury_hotels_query->have_posts() ) : $luxury_hotels_query->the_post(); ?>
            <div class="col-lg-5 col-md-6 align-self-center">
              <div class="row position-relative">
                <div class="col-lg-7 col-md-7 align-self-center">
                  <div class="about-img">
                    <?php if ( has_post_thumbnail() ) : ?>
                      <?php the_post_thumbnail( 'full', array( 'alt' => esc_attr( get_the_title() ) ) ); ?>
                    <?php else : ?>
                      <img src="<?php echo esc_url( $luxury_hotels_static_image ); ?>" alt="<?php esc_attr_e( 'Placeholder', 'luxury-hotels' ); ?>" />
                    <?php endif; ?>
                  </div>
                </div>
                <div class="col-lg-5 col-md-5 align-self-center">
                  <div class="about-banner">
                      <?php 
                      $luxury_hotels_image1 = get_theme_mod( 'luxury_hotels_abt_banner_image1', '' );
                      if ( $luxury_hotels_image1 ) : ?>
                          <img src="<?php echo esc_url( $luxury_hotels_image1 ); ?>" alt="<?php esc_attr_e( 'About Banner', 'luxury-hotels' ); ?>" />
                      <?php endif; ?>
                  </div>
                </div>
                <div class="about_btn more-btn-2">
                  <a href="<?php the_permalink(); ?>"><?php esc_html_e('Know More','luxury-hotels'); ?><i class="fas fa-arrow-right"></i></a>
                </div>
              </div>
            </div>
            <div class="col-lg-7 col-md-6 about-box align-self-center">
              <?php if( get_theme_mod('luxury_hotels_about_short_heading') != ''){ ?>
                <p class="section-title"><?php echo esc_html(get_theme_mod('luxury_hotels_about_short_heading','')); ?></p>
              <?php }?>
              <h2><a href="<?php echo esc_url( get_permalink() ); ?>"><?php the_title(); ?></a></h2>
              <p><?php echo wp_trim_words( get_the_content(),20 );?></p>
              <div class="row">
                <?php $luxury_hotels_about_point = get_theme_mod('luxury_hotels_about_points','6');
                for ( $luxury_hotels_m = 1; $luxury_hotels_m <= $luxury_hotels_about_point; $luxury_hotels_m++ ){ ?>
                  <div class="col-lg-6 col-md-6">
                    <?php if(get_theme_mod('luxury_hotels_about_points_text'.$luxury_hotels_m,'') != ''){ ?>
                    <h6><i class="fas fa-check me-2"></i><?php echo esc_html(get_theme_mod('luxury_hotels_about_points_text'.$luxury_hotels_m,'')); ?></h6>
                  <?php } ?>
                  </div>
              <?php } ?>
              </div> 
            </div>
          <?php endwhile; ?>
        <?php else : ?>
          <div class="no-postfound"></div>
        <?php endif;
      endif;
      wp_reset_postdata()?>
      <div class="clearfix"></div>
    </div>
  </div>
</section>
 <?php } ?>