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

get_header(); ?>

<?php if (get_theme_mod('kindergarten_playschool_slider_section_setting', true) != '') { ?>
  <section id="top-slider" style="background-image: url(<?php echo esc_url(get_template_directory_uri()) ?>/assets/img/slider-bg.png)">
  <div class="main-slider">
    <div class="container">
      <?php $kindergarten_playschool_slide_pages = array();
        for ( $kindergarten_playschool_count = 1; $kindergarten_playschool_count <= 3; $kindergarten_playschool_count++ ) {
          $kindergarten_playschool_mod = intval( get_theme_mod( 'kindergarten_playschool_top_slider_page' . $kindergarten_playschool_count ));
          if ( 'page-none-selected' != $kindergarten_playschool_mod ) {
            $kindergarten_playschool_slide_pages[] = $kindergarten_playschool_mod;
          }
        }
        if( !empty($kindergarten_playschool_slide_pages) ) :
          $kindergarten_playschool_args = array(
            'post_type' => 'page',
            'post__in' => $kindergarten_playschool_slide_pages,
            'orderby' => 'post__in'
          );
          $kindergarten_playschool_query = new WP_Query( $kindergarten_playschool_args );
          if ( $kindergarten_playschool_query->have_posts() ) :
            $i = 1;
        ?>
        <div class="owl-carousel" role="listbox">
          <?php  while ( $kindergarten_playschool_query->have_posts() ) : $kindergarten_playschool_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('kindergarten_playschool_slider_short_heading') != ''){ ?>
                    <h5 class="slider-short mb-3"><?php echo esc_html(get_theme_mod('kindergarten_playschool_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(), esc_attr(get_theme_mod('kindergarten_playschool_slider_excerpt_length', 15)) )); ?></p>
                  <div class="slide-btn mt-4">
                    <a href="<?php the_permalink(); ?>"><?php esc_html_e('Try For  Free','kindergarten-playschool'); ?> <i class="fas fa-arrow-right ms-2"></i></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 { ?><div class="slide-bg"></div> <?php } ?>
              </div>
            </div>
          <?php $i++; endwhile;
          wp_reset_postdata();?>
        </div>
        <?php else : ?>
          <div class="no-postfound"></div>
        <?php endif;
        endif;?>
      </div>
    </div>
  </section>
<?php } ?>

<?php if (get_theme_mod('kindergarten_playschool_activities_section_setting', true) != '') { ?>
  <section id="skip-content" class="featured py-5">
    <div class="container">
      <div class="row">
        <div class="col-lg-5 col-md-6 col-sm-12 col-12 align-self-center about-image">
          <?php if (get_theme_mod( 'kindergarten_playschool_about_us_image' )) { ?>
            <img class="about-img" src="<?php echo esc_url( get_theme_mod( 'kindergarten_playschool_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( 'kindergarten_playschool_about_us_small_image' )) { ?>
            <img class="about-img-small" src="<?php echo esc_url( get_theme_mod( 'kindergarten_playschool_about_us_small_image' )); ?>">
          <?php } else { ?>
            <img class="about-img-small" src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/img/slider.png" alt="" />
          <?php } ?>
          <?php if(get_theme_mod('kindergarten_playschool_about_us_box_number') != '' || get_theme_mod('kindergarten_playschool_about_us_box_title') != ''){ ?>
            <div class="box-heading">
              <div class="box-icon">
                <i class="fas fa-trophy"></i>
              </div>
              <?php if(get_theme_mod('kindergarten_playschool_about_us_box_number') != ''){ ?>
                <h5 class="box-title mb-2"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_box_number')); ?></h5>
              <?php }?>
              <?php if(get_theme_mod('kindergarten_playschool_about_us_box_title') != ''){ ?>
                <h6 class="box-short m-0"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_box_title')); ?></h6>
              <?php }?>
            </div>
          <?php } ?>
        </div>
        <div class="col-lg-7 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('kindergarten_playschool_about_us_title') != ''){ ?>
              <h5 class="main-title mb-3 mt-3"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_title')); ?></h5>
            <?php }?>
            <?php if(get_theme_mod('kindergarten_playschool_about_us_heading') != ''){ ?>
              <h3 class="main-heading mb-3"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_heading')); ?></h3>
            <?php }?>
            <?php if(get_theme_mod('kindergarten_playschool_about_us_content_1') != ''){ ?>
              <p class="content"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_content_1')); ?></p>
            <?php }?>
            <?php if(get_theme_mod('kindergarten_playschool_about_us_class_box_icon') != '' || get_theme_mod('kindergarten_playschool_about_us_class_box_heading') != '' || get_theme_mod('kindergarten_playschool_about_us_class_box_content') != ''){ ?>
              <div class="row classes-box">
                <div class="col-lg-1 col-md-3 col-sm-2 col-4 align-self-center icon-box">
                  <?php if(get_theme_mod('kindergarten_playschool_about_us_class_box_icon') != ''){ ?>
                   <i class="<?php echo esc_attr(get_theme_mod('kindergarten_playschool_about_us_class_box_icon')); ?>"></i>
                  <?php }?>
                </div>
                <div class="col-lg-11 col-md-9 col-sm-10 col-8 align-self-center box-content">
                  <?php if(get_theme_mod('kindergarten_playschool_about_us_class_box_heading') != ''){ ?>
                    <h5 class="class-title"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_class_box_heading')); ?></h5>
                  <?php }?>
                  <?php if(get_theme_mod('kindergarten_playschool_about_us_class_box_content') != ''){ ?>
                    <p class="class-heading"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_class_box_content')); ?></p>
                  <?php }?>
                </div>
              </div>
            <?php }?>
            <div class="row mt-4">
              <?php if(get_theme_mod('kindergarten_playschool_about_us_service_heading_1') != '' || get_theme_mod('kindergarten_playschool_about_us_service_content_1') != ''){ ?>
                <div class="col-lg-6 col-md-12 col-sm-6 col-12 align-self-center service-box">
                  <div class="service-image">
                    <img src="<?php echo esc_url(get_template_directory_uri()) ?>/assets/img/service1.png">
                  </div>
                  <div class="service-content">
                    <?php if(get_theme_mod('kindergarten_playschool_about_us_service_heading_1') != ''){ ?>
                      <h5 class="service-title"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_service_heading_1')); ?></h5>
                    <?php }?>
                    <?php if(get_theme_mod('kindergarten_playschool_about_us_service_content_1') != ''){ ?>
                      <p class="service-heading"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_service_content_1')); ?></p>
                    <?php }?>
                  </div>
                </div>
              <?php }?>
              <?php if(get_theme_mod('kindergarten_playschool_about_us_service_heading_2') != '' || get_theme_mod('kindergarten_playschool_about_us_service_content_2') != ''){ ?>
                <div class="col-lg-6 col-md-12 col-sm-6 col-12 align-self-center service-box">
                  <div class="service-image">
                    <img src="<?php echo esc_url(get_template_directory_uri()) ?>/assets/img/service2.png">
                  </div>
                  <div class="service-content">
                    <?php if(get_theme_mod('kindergarten_playschool_about_us_service_heading_2') != ''){ ?>
                      <h5 class="service-title"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_service_heading_2')); ?></h5>
                    <?php }?>
                    <?php if(get_theme_mod('kindergarten_playschool_about_us_service_content_2') != ''){ ?>
                      <p class="service-heading"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_service_content_2')); ?></p>
                    <?php }?>
                  </div>
                </div>
              <?php }?>
            </div>
            <?php if(get_theme_mod('kindergarten_playschool_about_us_button_url') != '' || get_theme_mod('kindergarten_playschool_about_us_button_text') != ''){ ?>
              <div class="about-btn mt-4">
                <a href="<?php echo esc_url(get_theme_mod('kindergarten_playschool_about_us_button_url')); ?>"><?php echo esc_html(get_theme_mod('kindergarten_playschool_about_us_button_text')); ?><i class="fas fa-arrow-right ms-2"></i></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(); ?>