Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // WP_Query arguments
- $args = array (
- 'posts_per_page' => '5',
- );
- $counter = 0;
- // The Query
- $query = new WP_Query( $args );
- // The Loop
- if ( $query->have_posts() ) {
- while ( $query->have_posts() ) {
- $query->the_post();
- if($counter === 0) {
- echo '<div class="gross">';
- the_post_thumbnail( 'medium' );
- the_title();
- the_content();
- } else {
- echo '<div class="klein">';
- the_post_thumbnail( 'thumbnail' );
- the_title();
- the_excerpt();
- }
- echo '</div>';
- $counter++;
- }//end while
- } else {
- echo 'Keine Beiträge gefunden';
- }
- // Restore original Post Data
- wp_reset_postdata();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement