Advertisement
alchymyth

loop

Nov 2nd, 2012
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.40 KB | None | 0 0
  1. <!--Bola-->
  2. <div class="ks_category_left">
  3. <h1 class="ks_h1_title_item1">Bola</h1>
  4. <?php $recent = new WP_Query("cat=4&showposts=4"); while($recent->have_posts()) : $recent->the_post();?>
  5. <?php if( $recent->current_post == 0 ) : //the first post with image, title, and excerpt// ?>
  6.     <div class="ks_posts_item1">
  7.         <div class="ks_postimage">
  8.         <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
  9. <?php get_the_image( array( 'size' => 'thumbnail', 'default_image' => 'http://kabarsore.com/noimages.jpg') ); ?>
  10.         </a>
  11.         </div>
  12.         <div class="ks_title_desc">
  13.             <div class="ks_postinfo">
  14.             <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
  15.             <h4><?php $tit = the_title('','',FALSE); echo substr($tit, 0, 60); if (strlen($tit) > 60) echo " ..."; ?></h4>
  16.             </a>
  17.             </div>
  18.             <div class="ks_desc">
  19.             <?php echo get_excerpt(145); ?>
  20.             </div>
  21.         </div>
  22.     </div>
  23. <?php else : //three further posts in listform//
  24. if( $recent->current_post == 1 ) echo '<ul class="ks_postlist">'; ?>
  25.     <li>
  26.         <div class="ks_postinfo">
  27.         <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
  28.         <h4><?php $tit = the_title('','',FALSE); echo substr($tit, 0, 60); if (strlen($tit) > 60) echo " ..."; ?></h4>
  29.         </a>
  30.         </div>
  31.     </li>
  32. <?php if( $recent->current_post == $recent->count_posts ) echo '</ul>';
  33. endif; ?>
  34.  
  35. <?php endwhile; ?>
  36. </div>
  37. <!--end Bola-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement