Query posts by category


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



Copy this code and paste it in your HTML
  1. <?php query_posts('cat=4');
  2. if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  3.  
  4. //post output goes here... index.php typically provides a good template
  5.  
  6. <?php endwhile; endif; ?>
  7. <?php wp_reset_query(); ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.