Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. $the_query = new WP_Query( $args );
  2. if ( $the_query->have_posts() ) : ?>
  3. <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
  4. <?php echo '<p>' .$post->ID .'</p>';?>
  5.  
  6. <?php endwhile; ?>
  7. <?php wp_reset_postdata(); ?>
  8. <?php else : ?>
  9. <p>No-data!</p>
  10. <?php endif; ?>
  11.  
  12. $the_query->have_posts();
  13. $the_query->the_post();
  14.  
  15. $the_query = new WP_Query( $args );
  16. if ( $the_query->have_posts() ) : ?>
  17. <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
  18. <?php echo '<p>' . get_the_ID() .'</p>';?>
  19.  
  20. <?php endwhile; ?>
  21. <?php wp_reset_postdata(); ?>
  22. <?php else : ?>
  23. <p>No-data!</p>
  24. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement