Advertisement
MrPauloeN

3 pierwsze posty + reszta miniatury | Multiple Loops in WP

Sep 5th, 2012
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1.  
  2. <div style="width: 960px;">
  3. <div id="3posty" >
  4.  
  5.  
  6.   <?php $my_query = new WP_Query('showposts=3');
  7.   while ($my_query->have_posts()) : $my_query->the_post();
  8.   $do_not_duplicate = $post->ID;?>
  9.  
  10.     <div id="posty-w-sliderze" >
  11.   <?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
  12.                     the_post_thumbnail();   } ?>
  13.                    
  14.     <?php the_title(); ?>  
  15.     <!-- Do stuff... -->
  16.     <?php the_content ();?>
  17.     <?php endwhile; ?>
  18.     <!-- Do other stuff... -->
  19.     </div>
  20.    
  21.    
  22. </div>
  23. <div class="clear"></div>
  24.  
  25. <div id="pozostale">
  26.    
  27.   <?php if (have_posts()) : while (have_posts()) : the_post();
  28.   if( $post->ID == $do_not_duplicate ) continue; ?>
  29.  
  30.  
  31. <div id="miniatury">
  32.  
  33.    <?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
  34.                     the_post_thumbnail()}?>
  35.  
  36.  
  37.    
  38. </div>
  39. <!-- Koniec Wyliczanki -->
  40.   <?php endwhile; else: ?>
  41.  
  42.    
  43.  
  44.         <p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
  45.         <!-- Czyszczenie! --><div class="clear"></div>
  46. </div>
  47.  
  48.  
  49. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement