Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1.  
  2. <?php
  3. // the query
  4. $the_query = new WP_Query('posts_per_page=1'); ?><!-- Display most recent post with large image -->
  5.  
  6. <?php if ( $the_query->have_posts() ) : ?>
  7.  
  8. <!-- the loop -->
  9. <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
  10. <div class="featured-news">
  11. <?php the_post_thumbnail( 'featured-news');?>
  12. <h4 class="featured-news"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4>
  13.  
  14. <?php the_excerpt(); ?>
  15. <p class="news-post-meta"><?php the_time( 'm/d/Y' ); ?></p>
  16. </div><!--.featured-news-->
  17. <?php endwhile; ?>
  18. <!-- end of the loop -->
  19.  
  20. <?php wp_reset_postdata(); ?>
  21.  
  22. <?php else : ?>
  23. <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
  24. <?php endif; ?>
  25.  
  26.  
  27. <?php
  28. // the query
  29. $the_query = new WP_Query(array( 'posts_per_page' => 5, 'offset' => 1 )); ?><!-- Display all other posts, with excerpts only -->
  30.  
  31. <?php if ( $the_query->have_posts() ) : ?>
  32.  
  33. <!-- the loop -->
  34. <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
  35. <div class="news-item">
  36. <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'home-news-thumb');?></a>
  37. <h4 class="news-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4>
  38. <p class="news-post-meta"><?php the_time( 'm/d/Y' ); ?></p>
  39. </div><!--.news-item-->
  40. <?php endwhile; ?>
  41. <!-- end of the loop -->
  42.  
  43. <?php wp_reset_postdata(); ?>
  44.  
  45. <?php else : ?>
  46. <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
  47. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement