Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <div id="primary" class="content-area">
- <div id="content" class="site-content" role="main">
- <?php $args1 = array('post_type' => array('whis_image','whis_how_to','whis_slideshow'), 'posts_per_page' =>1,'cat'=>3);
- $first_query = new WP_Query($args1);
- $todays_post = wp_list_pluck( $first_query->posts, 'ID' );
- if(! is_paged()){
- while($first_query->have_posts()) : $first_query->the_post(); ?>
- <div id="todays-post-container">
- <div id="todays-post-image">
- <?php if ( 'whis_slideshow' == get_post_type() ){
- $images = the_repeater_field('slideshow_images');
- $image_array = wp_get_attachment_image_src(get_sub_field('slideshow_image'), 'full'); ?>
- <a href="<?php the_permalink() ?>?display=slideshow" class="slideshow-fancybox"><img src="<?php echo $image_array[0] ?>" /></a>
- <?php } else {
- if ( get_field('post_image' ) ):
- $image = wp_get_attachment_image_src(get_field('post_image'), 'full');
- $image_url = $image[0];
- //$image_alt = get_the_title(get_field('post_image'));
- $image_alt = get_the_title();
- echo '<a href="' . $image_url . '" class="fancybox" title="'.$image_alt.'"><img src="' . $image_url . '" alt="'. $image_alt .'" /></a>';
- endif;
- }?>
- </div>
- <div id="todays-post-heading">
- <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>
- </div>
- <div id="todays-post-content">
- <?php global $more; $more = FALSE; ?>
- <?php the_content('Read more →'); ?>
- <?php if( function_exists( do_sociable() ) ){ do_sociable(); } ?>
- </div>
- <?php endwhile; ?>
- <img src="<?php bloginfo('template_directory'); ?>/images/post-line-960.png">
- </div><!-- end todays post div-->
- <?php wp_reset_postdata(); ?>
- <?php } // end is paged ?>
- <div id="home-posts-container">
- <?php if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
- elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
- else { $paged = 1; }
- query_posts(array(
- 'post_type' => array('whis_image','whis_how_to','whis_slideshow'),
- 'post__not_in' => $todays_post,
- 'cat' => -3,
- 'posts_per_page' => 6,
- 'paged'=>$paged,
- ));
- while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
- <div class="home-post-container">
- <div class="home-post-image">
- <?php if ( 'whis_slideshow' == get_post_type() ){
- if ( get_field('slideshow_images' ) ):
- $images = the_repeater_field('slideshow_images');
- $image_array = wp_get_attachment_image_src(get_sub_field('slideshow_image'), 'full');
- endif; ?>
- <a href="<?php the_permalink() ?>?display=slideshow" class="slideshow-fancybox"><img src="<?php echo $image_array[0] ?>" /></a>
- <?php
- } else {
- $image = wp_get_attachment_image_src(get_field('post_image'), 'full');
- $image_url = $image[0];
- $image_alt = get_the_title();
- echo '<a href="'.$image_url.'" class="fancybox" title="'.$image_alt.'"><img src="' . $image_url . '" alt="'. $image_alt .'" /></a>';
- } ?>
- </div>
- <div class="home-post-heading">
- <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; ?>
- </div>
- <div class="home-post-content">
- <?php global $more; $more = FALSE; ?>
- <?php the_content('Read more →'); ?>
- <?php if( function_exists( do_sociable() ) ){ do_sociable(); } ?>
- </div>
- <img src="<?php bloginfo('template_directory'); ?>/images/post-line-715.png">
- </div>
- <div class="clear"></div>
- <?php endwhile; ?>
- <div class="clear"></div>
- <?php wp_pagenavi( array( 'query' => $wp_query ) ); ?>
- </div><!-- #home posts-container -->
- <div id="sidebar">
- <?php get_sidebar(); ?>
- </div>
- </div><!-- #content .site-content -->
- </div><!-- #primary .content-area -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement