Wordpress Loop - WP_Query


/ Published in: PHP
Save to your folder(s)

Wordpress Loop - WP_Query


Copy this code and paste it in your HTML
  1. <!-- QUERY PERSONALIZADA -->
  2. <?php
  3. // The Query
  4. $the_query = new WP_Query( $args );
  5. // The Loop
  6. while ( $the_query->have_posts() ) : $the_query->the_post();
  7. setup_postdata($post);
  8. echo '<li>';
  9. the_title();
  10. echo '</li>';
  11. endwhile;
  12. // Reset Post Data
  13. wp_reset_postdata();
  14. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.