<?php

/**
 * Template Name: Custom Home Page
 */

get_header();

?>
<main id="maincontent" role="main">
<?php if( get_theme_mod('summer_camp_slider_hide_show', false)|| get_theme_mod( 'summer_camp_resp_slider_hide_show',false) == 1){ ?>
  <section id="slider">
    <?php $summer_camp_slider_pages = array();
      for ( $summer_camp_count = 1; $summer_camp_count <= 3; $summer_camp_count++ ) {
        $mod = intval( get_theme_mod( 'summer_camp_slider_page' .$summer_camp_count ));
        if ( 'page-none-selected' != $mod ) {
          $summer_camp_slider_pages[] = $mod;
        }
      }
      if( !empty($summer_camp_slider_pages) ) :
        $args = array(
          'post_type' => 'page',
          'post__in' => $summer_camp_slider_pages,
          'orderby' => 'post__in'
        );
        $query = new WP_Query( $args );?>
        <div class="owl-carousel">
          <?php
          if ( $query->have_posts() ) :
            $summer_camp_count = 1;
            while ( $query->have_posts() ) : $query->the_post(); ?>
            <div class="inner_carousel">
              <?php if(has_post_thumbnail()){
                  the_post_thumbnail();
                } else{?>
                <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/slider.png" alt="" />
              <?php } ?>
                <div class="image-overlay"></div>
                <div class="carousel-caption">
                  <?php if( get_theme_mod('summer_camp_slider_title_hide_show',true) == 1){ ?>
                    <span class="slider-badge mb-1"><?php echo esc_html(get_theme_mod('summer_camp_slider_small_title','Welcome To'));?>
                      <svg class="about-bg" width="100%" height="45" viewBox="0 0 200 45">
                      <image id="title_bg_2" width="100%" height="45" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAAAgCAMAAAD3wGCZAAAAAXNSR0IB2cksfwAAAkxQTFRFi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi4yIi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sfkML7crE2MS6gHrqQxTsTmmIJF8Yfp6xIwsGPsxXCM303fAwPgFBBw7IYyoI6RiWLcO0BOAQKXxU+RHFM5VW3gnAIEboytcMe4sr4aULcwMLCcAJEgx9TsGGCnAIHqcgawY2q3D7RLQIDzMMgxddsG2h1gYHv+AAOj7DvNgXYHBHg3MjA2bBloV0CB76G9jOZ/B9oVMHD3PSOHzkA7AgauVjI2bxxoR8DBe8aQBwPtBjgIYGxdP9BugIMgxva1A+0GOAhh7Lx/ZqAdAQMhjAy23wfaETAQBqybtDkH2hVQoAJ0TDfjioF2BhiIuoCaENXCywbaISCguhzcuOo/cXegXcLAEFMAbXZKR+HujdEJxDLmwXsHIrZEdd1oBeIZcxiQuir2ryPx11KJjMX/6x7ILw298DoW0mW8cMDgRWSJWIw0I2N6w2/5SeS6xF/hO1cMAwNKJ45p8ZHT2NQmlTLNZNx9gyln2bnecKymrXr6Syl80vJCxsf18+MX3ZQixVnO9yJC/0HZKN1b2ckVbTFacK7vhycbgiMZGVNZnhBvuMwMxpy0fYWFtmK2oWtq8CoV+1foveZuMUIAveO/K47j61zOJf/vNhb1F7/sjiHeFehgVUHGO79kH+GlAVv0zA1Xzt/JuA0UYtkPNu++uMXzvW7jtJx3aOkUAD5IpU9BioSsAAAAAElFTkSuQmCC"/>
                    </svg>
                    </span>
                  <?php }?>
                  <?php if( get_theme_mod('summer_camp_slider_title_hide_show',true) == 1){ ?>
                    <h1><a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php echo the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
                  <?php }?>
                  <?php if( get_theme_mod('summer_camp_slider_content_hide_show',true) == 1){ ?>
                    <p><?php $summer_camp_excerpt = get_the_excerpt(); echo esc_html( summer_camp_string_limit_words( $summer_camp_excerpt, esc_attr(get_theme_mod('summer_camp_slider_excerpt_number','30')))); ?></p>
                  <?php } ?>
                  <?php
                  $summer_camp_button_text = get_theme_mod('summer_camp_slider_button_text','Discover More');
                  $summer_camp_button_link = get_theme_mod('summer_camp_topbar_btn_link', '');
                  if (empty($summer_camp_button_link)) {
                    $summer_camp_button_link = get_permalink();
                  }
                  if ($summer_camp_button_text || !empty($summer_camp_button_link)) { ?>
                    <div class="slider-btn my-md-4 mt-2 ">
                      <?php if( get_theme_mod('summer_camp_slider_button_text','Discover More') != ''){ ?>
                        <a href="<?php echo esc_url($summer_camp_button_link); ?>" class="button redmor">
                        <?php echo esc_html($summer_camp_button_text); ?>
                          <span class="screen-reader-text"><?php echo esc_html($summer_camp_button_text); ?></span>
                        </a>
                      <?php } ?>
                    </div>
                 <?php } ?>
                </div>
              </div>
            <?php $summer_camp_count++; endwhile;
          wp_reset_postdata();?>
        </div>
        <?php else : ?>
          <div class="no-postfound"></div>
    <?php endif;
    endif;?>
    <div class="clearfix"></div>

  </section>
<?php }?>

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

<!-- Classes Section -->
<?php if( get_theme_mod('summer_camp_about_section',true) != ''){ ?>
  <section id="about-sec" class=" pt-5">
    <div class="container">
      <div class="about-setting text-center">
        <?php if(get_theme_mod('summer_camp_section_title') != ''){ ?>
          <strong><?php echo esc_html(get_theme_mod('summer_camp_section_title')); ?>
            <svg class="about-bg" width="100%" height="45" viewBox="0 0 200 45">
              <image id="title_bg_2" width="100%" height="45" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAAAgCAMAAAD3wGCZAAAAAXNSR0IB2cksfwAAAkxQTFRF7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU7uLU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M5VW3gnAIEboytcMe4sr4aULcwMLCcAJEgx9TsGGCnAIHqcgawY2q3D7RLQIDzMMgxddsG2h1gYHv+AAOj7DvNgXYHBHg3MjA2bBloV0CB76G9jOZ/B9oVMHD3PSOHzkA7AgauVjI2bxxoR8DBe8aQBwPtBjgIYGxdP9BugIMgxva1A+0GOAhh7Lx/ZqAdAQMhjAy23wfaETAQBqybtDkH2hVQoAJ0TDfjioF2BhiIuoCaENXCywbaISCguhzcuOo/cXegXcLAEFMAbXZKR+HujdEJxDLmwXsHIrZEdd1oBeIZcxiQuir2ryPx11KJjMX/6x7ILw298DoW0mW8cMDgRWSJWIw0I2N6w2/5SeS6xF/hO1cMAwNKJ45p8ZHT2NQmlTLNZNx9gyln2bnecKymrXr6Syl80vJCxsf18+MX3ZQixVnO9yJC/0HZKN1b2ckVbTFacK7vhycbgiMZGVNZnhBvuMwMxpy0fYWFtmK2oWtq8CoV+1foveZuMUIAveO/K47j61zOJf/vNhb1F7/sjiHeFehgVUHGO79kH+GlAVv0zA1Xzt/JuA0UYtkPNu++uMXzvW7jtJx3aOkUAD5IpU9BioSsAAAAAElFTkSuQmCC"/>
            </svg>
          </strong>
        <?php }?>
        <?php if(get_theme_mod('summer_camp_feature_courses_tagline_title') != '') {?>
          <h3 class="mb-4"><?php echo esc_html(get_theme_mod('summer_camp_feature_courses_tagline_title')) ?></h3>
        <?php }?>
      </div>
        <div class="owl-carousel">
            <?php
              $summer_camp_featured_post = get_theme_mod('summer_camp_claases_number');
            for ($summer_camp_i=1; $summer_camp_i <= $summer_camp_featured_post; $summer_camp_i++) { 
              $summer_camp_postData=  get_theme_mod('summer_camp_services_category'.$summer_camp_i);
              if($summer_camp_postData){ ?>
                <div class="feature-box">
                  <?php 
                    $args = array( 
                      'p' => esc_html($summer_camp_postData ,'summer-camp'),
                      'posts_per_page' => 1,
                      'post_type' => 'post'
                    );
                    $query = new WP_Query( $args );
                    if ( $query->have_posts() ) :
                      while ( $query->have_posts() ) : $query->the_post(); ?>
                        <div>
                        <div class="classes-inner-box">
                          <?php if(has_post_thumbnail()){
                          the_post_thumbnail(); ?>
                         <?php } ?>
                        </div>
                        <div class="icon text-center text-sm-center text-md-start text-lg-start"><a href="<?php the_permalink(); ?>"><i class="<?php echo esc_attr(get_theme_mod('summer_camp_single_icon'.$summer_camp_i,'fas fa-angle-right')); ?>"></i></a>
                        </div>
                        <div class="post-innter-content class-box-content text-center mx-3">
                          <h4 class="text-center mt-2 "><a href="<?php the_permalink(); ?>"><?php the_title(); ?><span class="screen-reader-text"><?php the_title(); ?></span></a></h4>
                          <p class="text-center"><?php $summer_camp_excerpt = get_the_excerpt(); echo esc_html( summer_camp_string_limit_words( $summer_camp_excerpt, esc_attr(get_theme_mod('summer_camp_slider_excerpt_number_post','15')))); ?> <?php echo esc_html(get_theme_mod('summer_camp_blog_excerpt_suffix1',''));?>
                          </p>
                        </div>
                        <div id="classes-box-age" class="row my-3">
                          <div class="col-lg-4 col-md-4 col-sm-4 col-4 text-center">
                            <div class="age-section">
                            <?php if( get_theme_mod('summer_camp_user'.$summer_camp_i) != ''){ ?>
                              <p class="mb-0"><?php esc_html_e( 'Age','summer-camp');?></p>
                              <div class="user-meta-fields mb-3">
                                <span class="user-text"><?php echo esc_html(get_theme_mod('summer_camp_user'.$summer_camp_i));?></span>
                              </div>
                            <?php }?>
                            </div>
                          </div>
                          <div class="col-lg-4 col-md-4 col-sm-4 col-4 text-center">
                            <div class="size-section">
                              <?php if( get_theme_mod('summer_camp_size'.$summer_camp_i) != ''){ ?>
                                <p class="mb-0"><?php esc_html_e( 'Size','summer-camp');?></p>
                                <div class="user-meta-fields mb-3">
                                  <span class="user-text"><?php echo esc_html(get_theme_mod('summer_camp_size'.$summer_camp_i));?></span>
                                </div>
                              <?php }?>
                            </div>
                          </div>
                          <div class="col-lg-4 col-md-4 col-sm-4 col-4 text-center">
                            <div class="price-section">
                              <?php if( get_theme_mod('summer_camp_price'.$summer_camp_i) != ''){ ?>
                                <p class="mb-0"><?php esc_html_e( 'Price','summer-camp');?></p>
                                <div class="user-meta-fields mb-3">
                                  <span class="user-text"><?php esc_html_e( '$','summer-camp');?><?php echo esc_html(get_theme_mod('summer_camp_price'.$summer_camp_i));?></span>
                                </div>
                              <?php }?>
                            </div>
                          </div>
                        </div>
                      </div>
                      <?php endwhile;
                        wp_reset_postdata();
                    endif; ?> 
                  </div>
              <?php }
            } ?>   
        </div>
    </div>
  </section>
<?php }?>
<?php do_action( 'summer_camp_after_service' ); ?>


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

<?php get_footer(); ?>


          