<?php
/* Template Name: Projects */  

get_header(); 
global $variable ;
while ( have_posts() ) : the_post(); 
$feat_image_slider_list = wp_get_attachment_url( get_post_thumbnail_id(get_the_ID()) ); 
?>
 <?php /*<section class="project sec-padding desktop">
    <div class="container">
      <div class="row align-items-center">
          <?php
           
                $k=1;
               $service_list = array( 'post_type' => array('project_list'), 'order_by' => 'id', 'order' => 'ASC', 'posts_per_page'   => -1 );
                      $posts_service_list =  get_posts( $service_list );
        
                foreach( $posts_service_list as $servicesnew_list)                      
                { 
        
                    $feat_image_service_list = wp_get_attachment_url( get_post_thumbnail_id($servicesnew_list->ID) ); 
                ?>
                <?php if($k%2==0){ ?>
                    <div class="col-md-7">
                      <div class="section-header">
                        <h2><?php  echo get_post_field('post_title',$servicesnew_list->ID); ?></h2>
                      </div>
                      <div class="project-content">
                        <p><?php  echo substr(get_post_field('post_content',$servicesnew_list->ID),0,400); ?></p>
                      </div>
                    </div>
                <?php } ?>
                    <div class="col-md-5">
                      <div class="img-box">
                        <div class="overlay"></div>
                        <div class="img-box-image">
                          <img src="<?php echo $feat_image_service_list;?>" alt="Service">
                        </div>
                        <div class="img-box-content">
                          <h3><?php  echo get_post_field('post_title',$servicesnew_list->ID); ?></h3>
                          <a href="<?php echo get_the_permalink($servicesnew_list->ID); ?>" class="p-button"><img src="<?php echo IMAGES_PATH; ?>/p-button.png" alt=""></a>
                        </div>
                      </div>
                    </div>
                    <?php if($k%2!=0){ ?>
                    <div class="col-md-7">
                      <div class="section-header">
                        <h2><?php  echo get_post_field('post_title',$servicesnew_list->ID); ?></h2>
                      </div>
                      <div class="project-content">
                        <p><?php  echo substr(get_post_field('post_content',$servicesnew_list->ID),0,400); ?></p>
                      </div>
                    </div>
                <?php } ?>
             <?php $k++; } ?>
      </div>
    </div>
  </section>*/ ?>
  
  <section class="project-sec-wraper">
<div class="container">
    <div class="row">
      <div class="col-12 col-md-12">
        <div class="project-right-wrap">
          <div class="megafolio-container">
             <?php 
            $images = get_field('project_gallery',get_the_ID());
            if( $images ): ?>
    
                <?php foreach( $images as $image ): ?>
                    <div class="mega-entry all civil" data-src="<?php echo $image; ?>" data-width="504" data-height="400">
                      <div class="project-cont">
                        <div class="middle">
                            <span class="top"></span>
                            <span class="bottom"></span>
                           <img src="<?php echo $image; ?>" class="img-fluid" alt="project"> 
                          <div class="overlay-1">
                            <a href="<?php echo $image; ?>" class="gallery" rel="prettyPhoto[gallery2]">
                              <i class="fa">
                                  <!--Project 1-->
                                  <img src="<?php echo IMAGES_PATH; ?>/magnify-icon.png" alt="">
                                  </i>
                            </a>
                          </div>
                        </div>
                      </div>
                    </div>
                <?php endforeach; ?>
    
            <?php endif; ?> 

          </div>
        </div>
      </div>
    </div>
</div>
  </section>
  
<?php 
endwhile;
get_footer();?>