<?php
/*
Template Name: Home Page
*/

?>

     <?php get_header(); ?>
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post-body page_home">
<?php get_sidebar(); ?>        
<div class="posts-wrap"> 

<div class="post" id="page">
          <div class="entry-content" id="page-content">
            
                <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
                
                <?php 
                $pages = get_pages('child_of=49&sort_column=menu_order');
                     $count_row = 1;
                     foreach  ($pages as $home_pages =>  $home_page):
                ?>
                  <div class="left static_blocks">
                       <h2><?php echo get_the_title(49); ?>  <span>- <?php echo get_the_title($home_page->ID); ?></span> </h2>
                       <div class="left thumbnail">
                            <img src="<? echo get_Image_url($home_page->ID,'s','thumbnail');?>" alt=""><br>
                            <a href="<?php echo get_permalink( $home_page->ID ); ?> " class="static_blocks_link">Read more</a>
                       </div>
                       <div class="left text_static_blocks">
                            <p>
                               <?php echo get_field('excerpt',$home_page->ID); ?>  
                            </p>
                       </div>
                </div>
                <?php 
                     
                     $count_row +=1;
                     if($count_row>2){echo '<div class="clear line"></div>'; $count_row = 1;}      
                     endforeach;
                ?>

                
                
                <?php 
                $pages = get_pages('child_of=51&sort_column=menu_order');
                     //$count_row = 1;
                     foreach  ($pages as $home_pages =>  $home_page):
                ?>
                  <div class="left static_blocks">
                       <h2><?php echo get_the_title(51); ?>  <span>- <?php echo get_the_title($home_page->ID); ?></span> </h2>
                       <div class="left thumbnail">
                            <img src="<? echo get_Image_url($home_page->ID,'s','thumbnail');?>" alt=""><br>
                            <a href="<?php echo get_permalink( $home_page->ID ); ?>" class="static_blocks_link">Read more</a>
                       </div>
                       <div class="left text_static_blocks">
                            <p>
                               <?php echo get_field('excerpt',$home_page->ID); ?>  
                            </p>
                       </div>
                </div>
                <?php 
                     
                     $count_row +=1;
                     if($count_row>2){echo '<div class="clear line"></div>'; $count_row = 1;}      
                     endforeach;
                ?>
              
            </div><!-- end #page-content -->

    </div><!-- end #page -->
    
            <?php endwhile; endif; ?>
            
    <?php edit_post_link( __('Edit this page', 'blank'), '<p>', '</p>'); ?>
 </div><!-- end .posts-wrap -->
 <br class="clear">
 </div>   


<?php get_footer(); ?>
