1. get_header(); ?>
  2.  
  3.     <div id="primary" class="content-area">
  4.     <div id="content" class="site-content" role="main">
  5.    
  6.     <?php if(! is_paged()){ ?>
  7.  
  8.          <?php $args1 = array('post_type' => array('whis_image','whis_how_to','whis_slideshow'), 'posts_per_page' =>1,'cat'=>3);
  9.  
  10.                $first_query = new WP_Query($args1);
  11.                while($first_query->have_posts()) : $first_query->the_post();
  12.                $todays_post = $post->ID; ?>
  13.                <div id="todays-post-container">
  14.                     <div id="todays-post-image">
  15.                     <?php if ( 'whis_slideshow' == get_post_type() ){
  16.                          
  17.                               $images = the_repeater_field('slideshow_images');
  18.                               $image_array = wp_get_attachment_image_src(get_sub_field('slideshow_image'), 'full'); ?>
  19.                               <a href="<?php the_permalink()  ?>?display=slideshow"  class="slideshow-fancybox"><img src="<?php echo $image_array[0] ?>" /></a>
  20.                    
  21.                     <?php } else {
  22.                                
  23.                                if ( get_field('post_image' ) ):
  24.  
  25.                                   $image = wp_get_attachment_image_src(get_field('post_image'), 'full');
  26.                                   $image_url =  $image[0];
  27.                                   //$image_alt = get_the_title(get_field('post_image'));
  28.                                   $image_alt = get_the_title();
  29.                                   echo '<a href="' .  $image_url . '" class="fancybox" title="'.$image_alt.'"><img src="' .  $image_url . '" alt="'.  $image_alt .'" /></a>';
  30.                        
  31.                                endif;
  32.                                
  33.                           }?>
  34.                     </div>    
  35.                
  36.                <div id="todays-post-heading">
  37.                     <a href="<?php the_permalink() ?>"><h2><?php the_title();?></h2> <h3> <?php the_time('F j, Y'); ?> at <?php the_time('g:i a');?></h3></a>
  38.                </div>
  39.            
  40.                <div id="todays-post-content">
  41.                        <?php global $more; $more = FALSE; ?>
  42.                        <?php the_content('Read more &rarr;'); ?>
  43.                        <?php if( function_exists( do_sociable() ) ){ do_sociable(); } ?>
  44.                     </div>
  45.  
  46.               <?php endwhile; ?>
  47.              
  48.             <img src="<?php bloginfo('template_directory'); ?>/images/post-line-960.png">
  49.          </div><!-- end todays post div-->
  50.             <?php wp_reset_postdata(); ?>
  51.        
  52.        <?php } // end is paged ?>
  53.        
  54.         <div id="home-posts-container">
  55.                        
  56.         <?php  if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
  57.                elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
  58.                else { $paged = 1; }
  59.    
  60.                query_posts(array(
  61.                       'post_type' => array('whis_image','whis_how_to','whis_slideshow'),
  62.                        //'post__not_in' => array($todays_post),
  63.                       'cat' => -3,
  64.                       'posts_per_page' => 6,
  65.                       'paged'=>$paged,
  66.                        ));
  67.  
  68.                 while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
  69.  
  70.                     <div class="home-post-container">
  71.                    
  72.                     <div class="home-post-image">
  73.                     <?php if ( 'whis_slideshow' == get_post_type() ){
  74.                               if ( get_field('slideshow_images' ) ):                                
  75.                                  $images = the_repeater_field('slideshow_images');
  76.                                  $image_array = wp_get_attachment_image_src(get_sub_field('slideshow_image'), 'full');
  77.                                
  78.                               endif; ?>
  79.                          
  80.                               <a href="<?php the_permalink()  ?>?display=slideshow"  class="slideshow-fancybox"><img src="<?php echo $image_array[0] ?>" /></a>
  81.                           <?php
  82.                           } else {
  83.                                $image = wp_get_attachment_image_src(get_field('post_image'), 'full');
  84.                                $image_url =  $image[0];
  85.                                $image_alt = get_the_title();
  86.                                 echo '<a href="'.$image_url.'" class="fancybox" title="'.$image_alt.'"><img src="' .  $image_url . '" alt="'.  $image_alt .'" /></a>';
  87.          
  88.                           } ?>
  89.                         </div>
  90.                      
  91.                         <div class="home-post-heading">
  92.                              <h2><a href="<?php the_permalink() ?>"><?php the_title();?></h2> <h3> <?php the_time('F j, Y'); ?> at <?php the_time('g:i a');?></h3></a><?php echo "ID= ".$post->ID; ?>
  93.                         </div>
  94.            
  95.                         <div class="home-post-content">
  96.                        
  97.                             <?php global $more; $more = FALSE; ?>
  98.                             <?php the_content('Read more &rarr;'); ?>
  99.                             <?php if( function_exists( do_sociable() ) ){ do_sociable(); } ?>
  100.                         </div>
  101.                         <img src="<?php bloginfo('template_directory'); ?>/images/post-line-715.png">
  102.                 </div>
  103.                 <div class="clear"></div>
  104.                
  105.          <?php endwhile;  ?>
  106.            
  107.             <div class="clear"></div>
  108.          
  109.          <?php wp_pagenavi( array( 'query' => $wp_query ) ); ?>
  110.                
  111.             </div><!-- #home posts-container -->
  112.            
  113.             <div id="sidebar">
  114.                 <?php get_sidebar(); ?>
  115.             </div>
  116.            
  117.     </div><!-- #content .site-content -->
  118.  
  119. </div><!-- #primary .content-area -->
  120.  
  121. <?php get_footer(); ?>