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

get_header(); ?>

<?php if (get_theme_mod('construction_demolition_services_slider_section_setting', false) != '') { ?>
  <section id="top-slider">
    <div class="container">
      <div class="main-slider">
        <?php if (get_theme_mod( 'construction_demolition_services_slider_background_image' )) { ?>
          <img class="slider-bg-img" src="<?php echo esc_url( get_theme_mod( 'construction_demolition_services_slider_background_image' )); ?>">
        <?php } else { ?>
          <img class="slider-bg-img" src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/img/slider.png" alt="" />
        <?php } ?>
        <div class="slider-main-box px-5">
          <?php $construction_demolition_services_slide_pages = array();
            for ( $construction_demolition_services_count = 1; $construction_demolition_services_count <= 3; $construction_demolition_services_count++ ) {
              $construction_demolition_services_mod = intval( get_theme_mod( 'construction_demolition_services_top_slider_page' . $construction_demolition_services_count ));
              if ( 'page-none-selected' != $construction_demolition_services_mod ) {
                $construction_demolition_services_slide_pages[] = $construction_demolition_services_mod;
              }
            }
            if( !empty($construction_demolition_services_slide_pages) ) :
              $construction_demolition_services_args = array(
                'post_type' => 'page',
                'post__in' => $construction_demolition_services_slide_pages,
                'orderby' => 'post__in'
              );
              $construction_demolition_services_query = new WP_Query( $construction_demolition_services_args );
              if ( $construction_demolition_services_query->have_posts() ) :
                $i = 1;
            ?>
          <div class="owl-carousel" role="listbox">
            <?php  while ( $construction_demolition_services_query->have_posts() ) : $construction_demolition_services_query->the_post(); ?>
              <div class="slide-box row m-0 pt-5">
                <div class="col-lg-6 col-md-6 col-sm-12 col-12 align-self-center">
                  <div class="slider-inner-box">
                    <?php if(get_theme_mod('construction_demolition_services_slider_short_heading') != ''){ ?>
                      <h5 class="slider-short mb-3"><?php echo esc_html(get_theme_mod('construction_demolition_services_slider_short_heading')); ?></h5>
                    <?php }?>
                    <h3 class="m-0"><?php the_title(); ?></h3>
                    <p class="content mt-3 pb-3"><?php echo esc_html( wp_trim_words( get_the_content(),15 )); ?></p>
                    <div class="slide-btn mt-4">
                      <a href="<?php the_permalink(); ?>"><?php esc_html_e('Get In Touch','construction-demolition-services'); ?></a>
                    </div>
                  </div>
                </div>
                <div class="slider-image col-lg-6 col-md-6 col-sm-12 col-12 align-self-center">
                  <?php if (has_post_thumbnail()) { ?><img class="sider-img" src="<?php the_post_thumbnail_url('full'); ?>" /><?php } else { ?><img class="sider-img" src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/img/slider-img.png" alt="" /> <?php } ?>
                </div>
              </div>
            <?php $i++; endwhile;
            wp_reset_postdata();?>
          </div>
          <?php else : ?>
            <div class="no-postfound"></div>
          <?php endif;
          endif;?>
        </div>
      </div>
    </div>
  </section>
<?php } ?>

<?php if (get_theme_mod('construction_demolition_services_activities_section_setting', false) != '') { ?>
  <section id="skip-content" class="featured py-5">
    <div class="container">
      <div class="row m-0">
        <div class="col-lg-4 col-md-6 col-sm-12 col-12 align-self-center about-image">
          <?php if (get_theme_mod( 'construction_demolition_services_about_us_image' )) { ?>
            <img class="about-img" src="<?php echo esc_url( get_theme_mod( 'construction_demolition_services_about_us_image' )); ?>">
          <?php } else { ?>
            <img class="about-img" src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/img/slider.png" alt="" />
          <?php } ?>

          <?php if(get_theme_mod('construction_demolition_services_online_courses_number') != '' ){ ?>
            <div class="image-box-2">
                <div class="align-self-center image-box-2-heading">
                  <h6 class="mb-0 contact-text"><?php echo esc_html(get_theme_mod('construction_demolition_services_online_courses_number','')); ?></h6>
                  <p class="mb-0"><?php echo esc_html(get_theme_mod('construction_demolition_services_online_courses_text','')); ?></p>
              </div>
            </div>
          <?php }?>
            
          <?php if(get_theme_mod('construction_demolition_services_about_us_box_number') != '' || get_theme_mod('construction_demolition_services_about_us_box_title') != ''){ ?>
            <div class="box-heading">
              <?php if(get_theme_mod('construction_demolition_services_about_us_box_number') != ''){ ?>
                <h5 class="box-title mb-2"><?php echo esc_html(get_theme_mod('construction_demolition_services_about_us_box_number')); ?></h5>
              <?php }?>
              <?php if(get_theme_mod('construction_demolition_services_about_us_box_title') != ''){ ?>
                <h6 class="box-short mb-2"><?php echo esc_html(get_theme_mod('construction_demolition_services_about_us_box_title')); ?></h6>
              <?php }?>
              <?php if (get_theme_mod( 'construction_demolition_services_slider_team_image' )) { ?>
                <img class="team-img-small" src="<?php echo esc_url( get_theme_mod( 'construction_demolition_services_slider_team_image' )); ?>">
              <?php } ?>
            </div>
          <?php } ?>
        </div>
        <div class="col-lg-8 col-md-6 col-sm-12 col-12 align-self-center content-box">
          <div class="heading text-lg-left mb-4">
            <?php if(get_theme_mod('construction_demolition_services_about_us_title') != ''){ ?>
              <h5 class="main-title mb-2"><?php echo esc_html(get_theme_mod('construction_demolition_services_about_us_title')); ?></h5>
            <?php }?>
            <?php if(get_theme_mod('construction_demolition_services_about_us_heading') != ''){ ?>
              <h3 class="main-heading mb-3"><?php echo esc_html(get_theme_mod('construction_demolition_services_about_us_heading')); ?></h3>
            <?php }?>
            
            <div class="my-4">
              <?php if(get_theme_mod('construction_demolition_services_about_us_service_heading_1') != '' || get_theme_mod('construction_demolition_services_about_us_service_content_1') != ''){ ?>
                <div class="service-box mb-4">
                  <div class="service-image-main">
                    <div class="service-image">
                      <i class="<?php echo esc_attr( get_theme_mod( 'construction_demolition_services_about_us_service_icon_1' )); ?>"></i>
                    </div>
                  </div>
                  <div class="service-content">
                    <?php if(get_theme_mod('construction_demolition_services_about_us_service_heading_1') != ''){ ?>
                      <h5 class="service-title"><?php echo esc_html(get_theme_mod('construction_demolition_services_about_us_service_heading_1')); ?></h5>
                    <?php }?>
                    <?php if(get_theme_mod('construction_demolition_services_about_us_service_content_1') != ''){ ?>
                      <p class="service-heading m-0"><?php echo esc_html(get_theme_mod('construction_demolition_services_about_us_service_content_1')); ?></p>
                    <?php }?>
                  </div>
                </div>
              <?php }?>
              <?php if(get_theme_mod('construction_demolition_services_about_us_service_heading_2') != '' || get_theme_mod('construction_demolition_services_about_us_service_content_2') != ''){ ?>
                <div class="service-box mb-4">
                  <div class="service-image-main">
                    <div class="service-image">
                      <i class="<?php echo esc_attr( get_theme_mod( 'construction_demolition_services_about_us_service_icon_2' )); ?>"></i>
                    </div>
                  </div>
                  <div class="service-content">
                    <?php if(get_theme_mod('construction_demolition_services_about_us_service_heading_2') != ''){ ?>
                      <h5 class="service-title"><?php echo esc_html(get_theme_mod('construction_demolition_services_about_us_service_heading_2')); ?></h5>
                    <?php }?>
                    <?php if(get_theme_mod('construction_demolition_services_about_us_service_content_2') != ''){ ?>
                      <p class="service-heading m-0"><?php echo esc_html(get_theme_mod('construction_demolition_services_about_us_service_content_2')); ?></p>
                    <?php }?>
                  </div>
                </div>
              <?php }?>
            </div>
            <?php if(get_theme_mod('construction_demolition_services_about_us_button_url') != '' || get_theme_mod('construction_demolition_services_about_us_button_text') != ''){ ?>
              <div class="about-btn mt-4 pt-2">
                <a href="<?php echo esc_url(get_theme_mod('construction_demolition_services_about_us_button_url')); ?>"><?php echo esc_html(get_theme_mod('construction_demolition_services_about_us_button_text')); ?></a>
              </div>
            <?php }?>
          </div>
        </div>
      </div>
    </div>
  </section>
<?php }?>
  <section id="page-content">
    <div class="container">
      <div class="py-5">
        <?php
          if ( have_posts() ) :
            while ( have_posts() ) : the_post();
              the_content();
            endwhile;
          endif;
        ?>
      </div>
    </div>
  </section>

<?php get_footer(); ?>