Advertisement
pixolin

Untitled

Aug 23rd, 2016
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. <?php
  2. // WP_Query arguments
  3. $args = array (
  4.     'posts_per_page'         => '5',
  5. );
  6. $counter = 0;
  7.  
  8. // The Query
  9. $query = new WP_Query( $args );
  10.  
  11. // The Loop
  12. if ( $query->have_posts() ) {
  13.     while ( $query->have_posts() ) {
  14.         $query->the_post();
  15.  
  16.         if($counter === 0) { 
  17.             echo '<div class="gross">';
  18.             the_post_thumbnail( 'medium' );
  19.             the_title();
  20.             the_content();
  21.         } else {
  22.             echo '<div class="klein">';
  23.             the_post_thumbnail( 'thumbnail' );
  24.             the_title();
  25.             the_excerpt();
  26.         }
  27.         echo '</div>';
  28.     $counter++;
  29.     }//end while
  30. } else {
  31.     echo 'Keine Beiträge gefunden';
  32. }
  33.  
  34. // Restore original Post Data
  35. wp_reset_postdata();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement