<?php
/**
 * This file is responsible for the display of front page.
 * @version:1.0
 */
get_header(); 
?>
<?php if(is_front_page()): ?>

            <!-- #banner start -->
            <section id="banner" class="pb_0" >
               <div class="container ">
                  <div class="row">
                     <!-- #banner-text start -->            
                     <div id="banner-text" class="col-md-12 text-c  ">
                        <div class="left-borders">
                           <p  class="banner-text wow fadeInUp main-h3" data-wow-delay="0.8s"></p>
                           <h5 class="wow fadeInUp main-h" data-wow-delay="0.2s" ><?php  _e(get_theme_mod('banner_title', __('' , 'star-law-firm-lite'))); ?></h5>
                        </div>
                        <p class="banner-text wow fadeInUp main-h3" data-wow-delay="0.8s"><?php _e (get_theme_mod('banner_text' , __('','star-law-firm-lite')));?></p>
                     </div>
                     <!-- /#banner-text End -->
                  </div>
                  <div class="row mt-100 p-0">
                     <!--#about-text start --> 

                    <?php
                    $about = get_theme_mod( 'homepage_about_section');
                      if(isset($about) && !empty($about)){
                      foreach ( $about as $item ) : ?>
                         <?php if ( ! wp_attachment_is_image( $item['about_image'] ) ){

                          $img_ur = esc_url_raw($item['about_image']);

                      } else {
                          $img_ur = wp_get_attachment_url($item['about_image']);
                      } ?>


                     <div class="who_we_area col-md-4 col-sm-6 wow fadeInUp">
                        <div class="service-1 color-after"">
                           <div class="servise-top wow fadeInUp">
                              <img src="<?php echo $img_ur; ?>">
                           </div>
                           <h2 class="unify"><?php echo ($item['about_text']); ?></h2>
                           <div class="button-div">
                              <a href="<?php echo ($item['button_link']); ?>" class="button-s"> <?php echo ($item['about_button_text']); ?> </a>
                           </div>
                        </div>
                     </div>

                      <?php endforeach; ?>
                      <?php }?>
                     
                     <!--#End about-text  --> 
                  </div>
               </div>
            </section>
         </div>
      </div>
      <!-- /#banner end -->

        <?php
            // Early exit if Kirki is not installed
          if ( ! class_exists( 'Kirki' ) ) {
            echo '<h5 class="kirki-nf">
              Please install recommended theme <a href="">plugins</a> to begin customizations. For instructions, click <a href="">here</a>.</h5>';

              get_footer();
            return;
          }

         $layout = maybe_unserialize( get_theme_mod( 'homepage_modules', 
                        array( 
                            'aboutus', 
                            'capablities' , 
                            'service' ,  
                            'testimonials',
                            'partner',
                            'news'
                          ) ) ); 

         if (!empty($layout)) {
             foreach ($layout as $module => $val) {
                 get_template_part('templates/modules/homepage/module', $val);
             }
         }
         ?>

 <script type="text/javascript">
    
    $ = jQuery;

 </script>
 
    <?php endif;?>
	 <?php get_footer();