Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // the query
- $the_query = new WP_Query('posts_per_page=1'); ?><!-- Display most recent post with large image -->
- <?php if ( $the_query->have_posts() ) : ?>
- <!-- the loop -->
- <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
- <div class="featured-news">
- <?php the_post_thumbnail( 'featured-news');?>
- <h4 class="featured-news"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4>
- <?php the_excerpt(); ?>
- <p class="news-post-meta"><?php the_time( 'm/d/Y' ); ?></p>
- </div><!--.featured-news-->
- <?php endwhile; ?>
- <!-- end of the loop -->
- <?php wp_reset_postdata(); ?>
- <?php else : ?>
- <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
- <?php endif; ?>
- <?php
- // the query
- $the_query = new WP_Query(array( 'posts_per_page' => 5, 'offset' => 1 )); ?><!-- Display all other posts, with excerpts only -->
- <?php if ( $the_query->have_posts() ) : ?>
- <!-- the loop -->
- <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
- <div class="news-item">
- <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'home-news-thumb');?></a>
- <h4 class="news-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4>
- <p class="news-post-meta"><?php the_time( 'm/d/Y' ); ?></p>
- </div><!--.news-item-->
- <?php endwhile; ?>
- <!-- end of the loop -->
- <?php wp_reset_postdata(); ?>
- <?php else : ?>
- <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement