Basic Query Post


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



Copy this code and paste it in your HTML
  1. <?php query_posts('posts_per_page=5'); ?>
  2.  
  3. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  4.  
  5. <?php endwhile; else: ?>
  6.  
  7. <?php endif; ?>
  8.  
  9. <?php wp_reset_query(); ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.