<?php
/**
 * Template Name: Custom Home Page
 */
get_header();

?>
<!-- banner section -->
<main id="maincontent" role="main">

  <?php do_action( 'vw_coaching_institute_above_banner' ); ?>
  
  <?php if (get_theme_mod('vw_coaching_institute_show_hide_banner', true)== 1 || get_theme_mod( 'vw_coaching_institute_resp_slider_hide_show', true) == 1){ ?>
    <section id="banner" class="position-relative wow bounceInDown delay-1000" data-wow-duration="3s">
      <div class="container">
        <div class="banner-content">
          <div class="row">
            <div class="col-lg-6 col-md-6 col-12 banner-main-text align-self-center">
              <div class="inner_carousel position-absolute">
                <?php if(get_theme_mod('vw_coaching_institute_subheading') != '') {?>
                  <p class="banner-sub-head text-capitalize"><?php echo esc_html(get_theme_mod('vw_coaching_institute_subheading')) ?></p>
                <?php }?>
                <?php if(get_theme_mod('vw_coaching_institute_tagline_title') != '') {?>
                  <h1 class="mb-3 text-capitalize"><?php echo esc_html(get_theme_mod('vw_coaching_institute_tagline_title')) ?></h1>
                <?php }?>
                <?php if(get_theme_mod('vw_coaching_institute_designation_text') != '') {?>
                  <p class="banner-para"><?php echo esc_html(get_theme_mod('vw_coaching_institute_designation_text')) ?></p>
                <?php }?>
                <div class="d-flex gap-2">
                  <?php if ( get_theme_mod('vw_coaching_institute_banner_button_label') != '' ) {?>
                    <div class ="banner-btn1 mt-4 mb-5">
                      <a href="<?php echo esc_url(get_theme_mod('vw_coaching_institute_top_button_url',false));?>" class="text-capitalize"><?php echo esc_html(get_theme_mod('vw_coaching_institute_banner_button_label'));?>
                      </a>
                    </div>
                  <?php }?>
                  <?php if ( get_theme_mod('vw_coaching_institute_banner_button_label1') != '' ) {?>
                    <div class ="banner-btn2 mt-4 mb-5">
                      <a href="<?php echo esc_url(get_theme_mod('vw_coaching_institute_top_button_url1',false));?>" class="text-capitalize"><?php echo esc_html(get_theme_mod('vw_coaching_institute_banner_button_label1'));?>
                      </a>
                    </div>
                  <?php }?>
                </div>
              </div>
            </div>
            <?php if (get_theme_mod('vw_coaching_institute_about_section_hide_show', true)){ ?>
              <div class="col-lg-6 col-md-6 col-12 text-center align-self-center banner-about mb-5">
                <div class="about-main-sec">
                  <div class="row">
                    <?php if( get_theme_mod( 'vw_coaching_institute_about_icon') != '' || get_theme_mod( 'vw_coaching_institute_about_title') != '' || get_theme_mod( 'vw_coaching_institute_about_text') != '') { ?>
                      <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12 about-content text-start position-relative px-0">
                        <?php if ( is_active_sidebar( 'social-widget-sidemenu' ) ) : ?>
                          <div class="topbar-social-icon position-absolute d-flex gap-3 align-items-center">
                            <p class="text-capitalize mb-0 follow-text"><?php esc_html_e( 'follow us', 'vw-coaching-institute' ); ?></p>
                            <?php dynamic_sidebar('social-widget-sidemenu'); ?>
                          </div>
                        <?php endif; ?>
                        <div class="p-3">
                          <i class="<?php echo esc_attr(get_theme_mod('vw_coaching_institute_about_icon','')); ?> about-icon"></i>
                          <?php if(get_theme_mod('vw_coaching_institute_about_title') != '') {?>
                            <p class="about mb-0 text-capitalize"><?php echo esc_html(get_theme_mod('vw_coaching_institute_about_title')) ?></p>
                          <?php }?>
                          <?php if(get_theme_mod('vw_coaching_institute_about_text') != '') {?>
                            <p class="about-text mb-0"><?php echo esc_html(get_theme_mod('vw_coaching_institute_about_text')) ?></p>
                          <?php }?>
                        </div>
                      </div>
                    <?php }?>
                    <?php if( get_theme_mod( 'vw_coaching_institute_add_image') != '') { ?>
                      <div class="col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12 px-0 side-main-img">
                        <?php if ( get_theme_mod('vw_coaching_institute_add_image') != "" ) { ?>
                          <div class="side-img">
                            <img src="<?php echo esc_url(get_theme_mod('vw_coaching_institute_add_image')); ?>" alt="" title="#slidecaption">
                          </div>
                        <?php } ?>
                      </div>
                    <?php }?>
                  </div>
                  <div class="row">
                    <?php if( get_theme_mod( 'vw_coaching_institute_review_image') != '' || get_theme_mod( 'vw_coaching_institute_review_img_title') != '' || get_theme_mod( 'vw_coaching_institute_review_img_text') != '' || get_theme_mod( 'vw_coaching_institute_user_image') != '') { ?>
                      <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12 review-main pe-0">
                        <div class="review-img-sec px-2 py-3">
                          <div class="row">
                            <div class="col-xxl-4 col-xl-5 col-lg-6 col-md-12 col-sm-12 col-12 align-self-center">
                              <?php if ( get_theme_mod('vw_coaching_institute_review_image') != "" ) { ?>
                                <img class="review-img" src="<?php echo esc_url(get_theme_mod('vw_coaching_institute_review_image')); ?>" alt="" title="#slidecaption">
                              <?php } ?>
                            </div>
                            <div class="col-xxl-8 col-xl-7 col-lg-6 col-md-12 col-sm-12 col-12 text-start align-self-center">
                              <?php if(get_theme_mod('vw_coaching_institute_review_img_title') != '') {?>
                                <p class="review-img-title text-capitalize mb-0"><?php echo esc_html(get_theme_mod('vw_coaching_institute_review_img_title')) ?></p>
                              <?php }?>
                              <?php if(get_theme_mod('vw_coaching_institute_review_img_text') != '') {?>
                                <p class="review-img-text mb-3 mt-2"><?php echo esc_html(get_theme_mod('vw_coaching_institute_review_img_text')) ?></p>
                              <?php }?>
                              <?php if ( get_theme_mod('vw_coaching_institute_user_image') != "" ) { ?>
                                <img class="user-img" src="<?php echo esc_url(get_theme_mod('vw_coaching_institute_user_image')); ?>" alt="" title="#slidecaption">
                              <?php } ?>
                            </div>
                          </div>
                        </div>
                      </div>
                    <?php }?>
                    <?php if( get_theme_mod( 'vw_coaching_institute_about_icon1') != '' || get_theme_mod( 'vw_coaching_institute_about_title1') != '' || get_theme_mod( 'vw_coaching_institute_about_text1') != '') { ?>
                      <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12 about-content text-start px-0">
                        <div class="p-3">
                          <i class="<?php echo esc_attr(get_theme_mod('vw_coaching_institute_about_icon1','')); ?> about-icon"></i>
                          <?php if(get_theme_mod('vw_coaching_institute_about_title1') != '') {?>
                            <p class="about mb-0 text-capitalize"><?php echo esc_html(get_theme_mod('vw_coaching_institute_about_title1')) ?></p>
                          <?php }?>
                          <?php if(get_theme_mod('vw_coaching_institute_about_text1') != '') {?>
                            <p class="about-text mb-0"><?php echo esc_html(get_theme_mod('vw_coaching_institute_about_text1')) ?></p>
                          <?php }?>
                        </div>
                      </div>
                    <?php }?>
                  </div>
                  <div class="review-box p-4 mt-3">
                    <div class="row">
                      <?php for ($vw_coaching_institute_j=1; $vw_coaching_institute_j <= 2; $vw_coaching_institute_j++) { ?>
                      <div class="col-xl-6 col-lg-6 col-md-6 col-6 align-self-center">
                        <div class="row">
                          <div class="col-xl-2 col-lg-2 col-md-3 col-3 align-self-center">
                            <i class="<?php echo esc_attr(get_theme_mod('vw_coaching_institute_review_icon'.$vw_coaching_institute_j,'')); ?> review-icon"></i>
                          </div>
                          <div class="col-xl-10 col-lg-10 col-md-9 col-9 align-self-center text-start">
                            <?php if(get_theme_mod('vw_coaching_institute_review'.$vw_coaching_institute_j) != '') {?>
                              <p class="review mb-0"><?php echo esc_html(get_theme_mod('vw_coaching_institute_review'.$vw_coaching_institute_j)) ?></p>
                            <?php }?>
                            <?php if(get_theme_mod('vw_coaching_institute_review_text'.$vw_coaching_institute_j) != '') {?>
                              <p class="review-text text-capitalize mb-0"><?php echo esc_html(get_theme_mod('vw_coaching_institute_review_text'.$vw_coaching_institute_j)) ?></p>
                            <?php }?>
                          </div>
                        </div>
                      </div>
                      <?php }?>
                    </div>
                  </div>
                </div>
              </div>
            <?php }?>
          </div>
        </div> 
      </div>
      <div class="clearfix"></div>
    </section>
  <?php }?>

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

  <!-- Courses Section -->
  <?php if (get_theme_mod('vw_coaching_institute_courses_section_hide_show', true)){ ?>
    <section id="courses-section" class="pt-5 wow fadeInLeftBig" data-wow-delay=".25s">
      <div class="container">
        <div class="row">
          <div class="col-xl-8 col-lg-8 col-md-8 col-12">
            <div class="section-content text-center mb-1">
              <?php if(get_theme_mod('vw_coaching_institute_courses_section_text') != '') {?>
                <p class="section-text mb-2 text-start text-capitalize"><?php echo esc_html(get_theme_mod('vw_coaching_institute_courses_section_text')) ?></p>
              <?php }?>
              <?php if(get_theme_mod('vw_coaching_institute_courses_section_title') != '') {?>
                <h2 class="section-title text-start text-capitalize"><?php echo esc_html(get_theme_mod('vw_coaching_institute_courses_section_title')) ?></h2>
              <?php }?>
            </div>
          </div>
          <div class="col-xl-4 col-lg-4 col-md-4 col-12 text-lg-end text-md-end text-start">
            <?php if ( get_theme_mod('vw_coaching_institute_courses_button_label') != '' ) {?>
              <div class ="explore-btn mt-4 mb-5">
                <a href="<?php echo esc_url(get_theme_mod('vw_coaching_institute_courses_button_url',false));?>" class="text-capitalize"><?php echo esc_html(get_theme_mod('vw_coaching_institute_courses_button_label'));?>
                </a>
              </div>
            <?php }?>
          </div>
        </div>
        <div class="row py-2">
          <?php
            $vw_coaching_institute_featured_post = get_theme_mod('vw_coaching_institute_claases_number');
          for ($vw_coaching_institute_i=1; $vw_coaching_institute_i <= $vw_coaching_institute_featured_post; $vw_coaching_institute_i++) {
            $vw_coaching_institute_postData=  get_theme_mod('vw_coaching_institute_services_category'.$vw_coaching_institute_i);
            if($vw_coaching_institute_postData){ ?>
              <?php
                $args = array(
                  'p' => esc_html($vw_coaching_institute_postData ,'vw-coaching-institute'),
                  'posts_per_page' => 1,
                  'post_type' => 'post'
                );
                $query = new WP_Query( $args );
                if ( $query->have_posts() ) :
                  while ( $query->have_posts() ) : $query->the_post(); ?>
                  <div class="col-xl-4 col-sm-6 pb-4 courses-main">
                    <div class="courses-box p-3">
                      <div class="classes-inner-box">
                        <?php if(has_post_thumbnail()){ ?>
                          <?php the_post_thumbnail(); ?>
                        <?php } else {?>
                          <img src="<?php echo esc_url(get_template_directory_uri()) ?>/assets/images/post-image.png" alt="<?php echo esc_attr('Post Image', 'vw-coaching-institute'); ?>">
                        <?php }?>
                      </div>
                      <div class="popular-content wow bounceInLeft delay-1000 mt-3">
                        <div class="row">
                          <div class="col-xl-6 col-lg-6 col-md-6 col-6 align-self-center">
                            <div class="price-section">
                              <?php if( get_theme_mod('vw_coaching_institute_sale_price'.$vw_coaching_institute_i) != ''){ ?>
                                <span class="sale-price me-1"><?php echo esc_html(get_theme_mod('vw_coaching_institute_sale_price'.$vw_coaching_institute_i));?></span>
                              <?php }?>
                              <?php if( get_theme_mod('vw_coaching_institute_regular_price'.$vw_coaching_institute_i) != ''){ ?>
                                <span class="regular-price"><?php echo esc_html(get_theme_mod('vw_coaching_institute_regular_price'.$vw_coaching_institute_i));?></span>
                              <?php }?>
                            </div>
                          </div>
                          <div class="col-xl-6 col-lg-6 col-md-6 col-6 align-self-center">
                            <div class="post-reviews">
                              <?php echo do_shortcode( '[kkstarratings]' );?>
                            </div>
                          </div>
                        </div>
                        <h3 class="text-capitalize course-heading"><a href="<?php the_permalink(); ?>"><?php the_title(); ?><span class="screen-reader-text"><?php the_title(); ?></span></a></h3>
                      </div>
                      <div class="row">
                        <div class="col-xl-6 col-lg-6 col-md-6 col-6 d-flex align-items-center gap-2 author-sec">
                          <?php if ( get_theme_mod('vw_coaching_institute_author_image'.$vw_coaching_institute_i) != "" ) { ?>
                            <img class="author-img" src="<?php echo esc_url(get_theme_mod('vw_coaching_institute_author_image'.$vw_coaching_institute_i)); ?>" alt="" title="#slidecaption">
                          <?php } ?><a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' )) ); ?>"><?php the_author(); ?><span class="screen-reader-text"><?php the_author(); ?></span></a>
                        </div>
                        <div class="col-xl-6 col-lg-6 col-md-6 col-6 enroll-now text-end align-self-center">
                          <a href="<?php the_permalink(); ?>">
                            <?php echo esc_html(get_theme_mod('vw_coaching_institute_service_button_label'.$vw_coaching_institute_i, __('Enroll Now', 'vw-coaching-institute'))); ?>
                            <span class="screen-reader-text">
                              <?php echo esc_html(get_theme_mod('vw_coaching_institute_service_button_label'.$vw_coaching_institute_i, __('Enroll Now', 'vw-coaching-institute'))); ?>
                            </span>
                          </a>
                        </div>
                      </div>
                    </div>
                  </div>
                <?php endwhile;
                  wp_reset_postdata();
                endif; ?>
            <?php }
          } ?>
        </div>
      </div>
    </section>
  <?php }?>
  <?php do_action( 'vw_coaching_institute_after_service' ); ?>

  <div id="content-vw" class="entry-content pt-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(); ?> 