Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. // WP_Query arguments
  2. $args = array(
  3. 'post_type' => array( 'vastgoed' ),
  4. 'nopaging' => true,
  5. 'posts_per_page' => '2',
  6. 'order' => 'DESC',
  7. );
  8.  
  9. // The Query
  10. $query = new WP_Query( $args );
  11.  
  12. // The Loop
  13. if ( $query->have_posts() ) {
  14. while ( $query->have_posts() ) {
  15. $query->the_post();
  16. // do something
  17. }
  18. } else {
  19. // no posts found
  20. }
  21.  
  22. // Restore original Post Data
  23. wp_reset_postdata();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement