<?php if ( is_home() || is_front_page() ) { ?>
<div id="wrapOne" <?php if( of_get_option('hidethreebxsec', true) != '' ) { ?>style="display:none"<?php } ?>>
    <div class="container">
        <div class="services-wrap">
        <?php
			$boxArr = array();
			 if( of_get_option('box1',true) != '' ){
			  $boxArr[] = of_get_option('box1',false);
			 }
			 if( of_get_option('box2',true) != '' ){
			  $boxArr[] = of_get_option('box2',false);
			 }
			 if( of_get_option('box3',true) != '' ){
			  $boxArr[] = of_get_option('box3',false);
			 }
			 if( of_get_option('box4',true) != '' ){
			  $boxArr[] = of_get_option('box4',false);
			 }
			 if( of_get_option('box5',true) != '' ){
			  $boxArr[] = of_get_option('box5',false);
			 }
			 if( of_get_option('box6',true) != '' ){
			  $boxArr[] = of_get_option('box6',false);
			 }
			
			
			if (!array_filter($boxArr)) {
			for($fx=1; $fx<=3; $fx++) {
			?>
            <div class="one_third <?php if($fx % 1 == 0) { echo "columbgcolor1"; } ?>  <?php if($fx % 2 == 0) { echo "columbgcolor2"; } ?>  <?php if($fx % 3 == 0) { echo "columbgcolor3"; } ?> <?php if($fx % 3 == 0) { echo "last_column"; } ?>">
             <a href="#">
             <img src="<?php bloginfo( 'template_url' ); ?>/images/services-image-<?php echo $fx; ?>.png" alt="" width="85px" height="85" />
             <h3><?php _e('Yoga For Fitness', 'skt-yogi') ?><?php echo $fx; ?></h3>            
             </a>
             <p><?php _e('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ullamcorper dolor urna, sit amet rhoncus metus efficitur in. Quisque nec gravida elit.', 'skt-yogi') ?></p>
             <?php if( of_get_option('threecolreadmorebutton',true) !== '') { ?>
                  <a class="rdmore" href="#"><?php echo of_get_option('threecolreadmorebutton'); ?></a>                  
				  <?php } ?>
         	</div>
			<?php 
			} 
			} else {
				$box_column = array('no_column','one_column','two_column','three_column','four_column','five_column','six_column');
				$fx = 1;
				$queryvar = new wp_query(array('post_type' => 'page', 'post__in' => $boxArr, 'posts_per_page' => 6, 'orderby' => 'post__in' ));		
				while( $queryvar->have_posts() ) : $queryvar->the_post(); ?> 
        	    <div class="one_third <?php if($fx % 1 == 0) { echo "columbgcolor1"; } ?>  <?php if($fx % 2 == 0) { echo "columbgcolor2"; } ?>  <?php if($fx % 3 == 0) { echo "columbgcolor3"; } ?> <?php echo $box_column[count($boxArr)]; ?> <?php if($fx % count($boxArr) == 0) { echo "last_column"; } ?>">
				 <a href="<?php the_permalink(); ?>">                
				    <img alt="" width="85px" height="85" src="<?php echo esc_url( of_get_option( 'boximg'.$fx, true )); ?>" / >                  
                  <h3><?php the_title(); ?></h3></a>
                  <?php echo content( of_get_option('servicesbxexcerptlength') ); ?>
                                    
				  <?php if( of_get_option('threecolreadmorebutton',true) !== '') { ?>
                  <a class="rdmore" href="<?php the_permalink(); ?>"><?php echo of_get_option('threecolreadmorebutton'); ?></a>                  
				  <?php } ?>
        	   </div>
             <?php 
			 $fx++; 
			 endwhile;
			 wp_reset_query();
			 }
			 ?>
        
        
        </div><!-- .services-wrap-->
    <div class="clear"></div>
    </div><!-- .container -->
</div><!-- #wrapOne -->

<section id="wrapTwo" <?php if( of_get_option('hidewelcomesec', true) != '' ) { ?>style="display:none"<?php } ?>>
        <div class="container">
            <div class="wrap_two">
             <?php if( of_get_option('welcomepage',false) ) { ?>
        		<?php $queryvar = new wp_query('page_id='.of_get_option('welcomepage',true));				
						while( $queryvar->have_posts() ) : $queryvar->the_post(); ?> 
                        <h2 class="section_title"><?php the_title(); ?></h2>
                           <img width="570" alt="" src="<?php echo esc_url( of_get_option( 'welcomeimg', true )); ?>" / >     
                         <?php the_content(); ?>                       
                         <?php if( of_get_option('welcomemoreinfo',true) !== '') { ?>
                 			 <a class="linkreadmore" href="<?php the_permalink(); ?>"><?php echo of_get_option('welcomemoreinfo'); ?></a>                  
				  		<?php } ?>
                         
						<?php endwhile;
						wp_reset_query(); ?>
               <?php } else { ?>
                <h2 class="section_title"><?php _e('Welcome To Yogasana', 'skt-yogi') ?></h2>
                <img src="<?php echo get_template_directory_uri(); ?>/images/welcomeimage.jpg">               
                <p><?php _e('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ut mauris et magna suscipit egestas eu eu ipsum. Phasellus hendrerit ac ex ut aliquam. Donec lacinia rutrum sem, et luctus urna egestas vitae. Cras consequat, ante sed pharetra accumsan, massa enim faucibus neque, ac scelerisque metus nisl fermentum tellus.', 'skt-yogi') ?></p>
<p><?php _e('Ut ut condimentum felis. Nulla quis nulla nulla. Donec placerat tincidunt ex. Nunc dictum enim arcu, id fermentum urna rhoncus ac. Morbi non tortor eget sem ultrices fringilla vel sit amet turpis. Quisque tincidunt, enim et aliquam ultrices, nunc odio ullamcorper sapien, ac accumsan arcu est in lectus. Pellentesque nisl libero, finibus et turpis a, mattis suscipit nibh. Etiam dignissim, odio a tincidunt molestie, est orci laoreet urna, vitae egestas dui mi eu quam. Morbi non dictum libero. Quisque non molestie dolor. Vestibulum maximus magna et luctus porta. Nulla facilisi.', 'skt-yogi') ?>
</p>

 <?php if( of_get_option('welcomemoreinfo',true) !== '') { ?>
                  <a class="linkreadmore" href="#"><?php echo of_get_option('welcomemoreinfo'); ?></a>                  
				  <?php } ?>
                 
             <?php } ?>
            </div><!-- .wrap_one-->
            <div class="clear"></div>
        </div><!-- .container -->
    </section><!-- #wrapOne -->
<?php } ?>
