   <?php
/**
 * This file is responsible for the gallery section on front page.
 * @version:1.0
 */
?> 

<?php if ( true == get_theme_mod( 'galleryonoff', true ) ) : ?>
      <!--#Our Gallery Area start -->
      <section id="gallery"  class="our_services_area">
         <div class="container">
            <div class="title wow fadeInUp pt_40">
               <h2><?php _e(get_theme_mod('homepage_gallery_title', __('Our gallery' , 'plumbing-lite'))); ?></h2>
            </div>
             <div class="portfolio_filter">
              <ul>
          
               <?php 

               $gallery_name = get_theme_mod( 'homepage_gallery_name');

              foreach ( $gallery_name as $items ) : 
               ?>
               <li data-filter="*" class="active"><a href=""><?php echo $items['gallery_name']; ?></a></li>
            <?php 
              endforeach; 
            ?>
             </ul>
               </div>

            <div class="portfolio_inner_area">
               <div class="portfolio_item">
                  <div class="grid-sizer"></div>
            <?php
               $gallery_items = get_theme_mod( 'homepage_gallery_');
               if(isset($gallery_items) && !empty($gallery_items)){
               foreach ( $gallery_items as $items ) : ?>
                  <?php if ( ! wp_attachment_is_image( $items['gallery_image'] ) ){

                   $imgurl = esc_url_raw($items['gallery_image']);

               } else {
                   $imgurl = wp_get_attachment_url($items['gallery_image']);
               } 

         ?>

                  <div class="single_facilities col-xs-12  col-md-4 p0 painting photography adversting">
                     <div class="single_facilities_inner">
                        <img src="<?php echo $imgurl; ?>" alt="">
                     
                     </div>
                  </div>
         
         <?php endforeach; ?>
         <?php }?>
                 
               </div>
            </div>
         </div>
      </section>
      <!--#End Our Gallery Area -->
      <?php endif; ?>

<?php if ( true == get_theme_mod( 'achieveonoff', true ) ) : ?>
      <!--#Our Achievments Area start  -->
      <section  id="Achievments" class="our_achievments_area" data-stellar-background-ratio="0.3" style="background: url(<?php echo esc_attr(get_theme_mod('homepage_achievments_background_image',  get_template_directory_uri() . '/assets/images/contact-bg_top.jpg','plumbing-lite')) ?>) fixed no-repeat;">
         <div class="container" >
            <div class="title wow fadeInUp pt_40">
               <h2><?php _e(get_theme_mod('homepage_achievments_title', __('Our Achievments' , 'plumbing-lite'))); ?></h2>
            </div>
            <div class="achievments_row row">
               <div class="col-md-3 col-sm-6 p0 completed">
                  <i class="fa fa-<?php echo esc_attr(get_theme_mod('homepage_achieve_icon_1' ,'fa fa-connectdevelop'),'plumbing-lite'); ?>" aria-hidden="true"></i>
                  <span class="counter"><?php _e(get_theme_mod('homepage_achievments_title1', __('800' , 'plumbing-lite'))); ?></span>
                  <h6> <?php _e(get_theme_mod('homepage__achievmentstext1' ,__('Project completed','plumbing-lite')));  ?></h6>
               </div>
               <div class="col-md-3 col-sm-6 p0 completed">
                  <i class="fa fa-<?php echo esc_attr(get_theme_mod('homepage_achieve_icon_2' ,'fa fa-home'),'plumbing-lite'); ?>" aria-hidden="true"></i>
                  <span class="counter"><?php _e(get_theme_mod('homepage_achievments_title2', __('230' , 'plumbing-lite'))); ?></span>
                  <h6> <?php _e(get_theme_mod('homepage__achievmentstext2' , __('House renovations','plumbing-lite')));  ?></h6>
               </div>
               <div class="col-md-3 col-sm-6 p0 completed">
                  <i class="fa fa-<?php echo esc_attr(get_theme_mod('homepage_achieve_icon_3' ,'fa fa-child'),'plumbing-lite'); ?>" aria-hidden="true"></i>
                  <span class="counter"><?php _e(get_theme_mod('homepage_achievments_title3', __('1390' , 'plumbing-lite'))); ?></span>
                  <h6> <?php _e(get_theme_mod('homepage__achievmentstext3' , __('Workers Emloyed','plumbing-lite')));  ?></h6>
               </div>
               <div class="col-md-3 col-sm-6 p0 completed">
                  <i class="fa fa-<?php echo esc_attr(get_theme_mod('homepage_achieve_icon_4' ,'fa fa-trophy'),'plumbing-lite'); ?>" aria-hidden="true"></i>
                  <span class="counter"><?php _e(get_theme_mod('homepage_achievments_title4', __('125' , 'plumbing-lite'))); ?></span>
                  <h6> <?php _e(get_theme_mod('homepage__achievmentstext4' , __('Awards Won','plumbing-lite')));  ?></h6>
               </div>
            </div>
         </div>
      </section>
      <!-- End Our Achievments Area -->
      
      <!--#End Our Team Area -->
      <?php endif; ?>