php - WordPress: First post in full, others show excerpts -
i've set wordpress template show first post in full, , others excerpts: http://growthgroup.com/testing-blog
when go page 2 of posts, shows first post in full, , others excerpts too, recent post full post, , others excerpts.
is there way around this? here code using:
<?php // query set posts per page 5 $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array('posts_per_page' => 5, 'paged' => $paged ); query_posts($args); ?> <?php if (have_posts()) : ?> <?php $postcount = 0; // initialize post counter ?> <?php while (have_posts()) : the_post(); //start loop ?> <?php $postcount++; //add 1 post counter ?> <?php if ($postcount == 1) : // if first post ?> <div class="post"> <h3 class="post-title"><a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php the_title(); ?></a></h3> <span class="author-date-blog"><?php the_author();?> | <?php the_date('d m y');?></span> <div class="excerpt"> <?php the_content();?> <div class="read-more"> <a href="<?php the_permalink();?>#disqus_thread">leave comment >></a> </div> </div> </div> <?php else : //if not first post ?> <div class="post"> <div class="thumb"> <a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php the_post_thumbnail('blog-thumb');?></a> </div> <h3 class="post-title"><a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php the_title(); ?></a></h3> <span class="author-date-blog"><?php the_author();?> | <?php the_date('d m y');?></span> <div class="excerpt"> <?php the_excerpt(); ?> <div class="read-more"> <a href="<?php the_permalink();?>">read more >></a> </div> </div> </div> <?php endif; endwhile; //end of check first post - other posts?>
if i'm understanding correctly, think might you're after:
<?php if ($postcount == 1 && $paged == 1) : // if first post & first page ?> that should make upper conditional fire on first post of first page only.
Comments
Post a Comment