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