Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2. // Example argument that defines three posts per page.
  3. $args = array( 'posts_per_page' => 3 );
  4.  
  5. // Variable to call WP_Query.
  6. $the_query = new WP_Query( $args );
  7.  
  8. if ( $the_query->have_posts() ) :
  9. // Start the Loop
  10. while ( $the_query->have_posts() ) : $the_query->the_post();
  11. the_title();
  12. the_excerpt();
  13. // End the Loop
  14. endwhile;
  15. else:
  16. // If no posts match this query, output this text.
  17. _e( 'Sorry, no posts matched your criteria.', 'textdomain' );
  18. endif;
  19. wp_reset_postdata();
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement