Adding a second loop to your WordPress site

You can list blog posts anywhere in your website, by adding a second loop.

Use this code: (edit the category name and number of posts to show – you can also edit what the loop shows, just listing the names of posts, linking to them, or add the summary/content…)

<?php rewind_posts(); ?>

<?php query_posts(‘category_name=NAME&showposts=5′); ?>

<?php while (have_posts()) : the_post(); ?>
<!– Do featured stuff… –>
<li><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></a></li>
<?php // the_excerpt(); ?>
<?php //<div class=”entry”>
// the_content();
//</div> ?></li>
<?php endwhile;

<p class=”right”><a href=”/NAME/”>All posts</a></p>

The last link is just a link to the category name so you can show all.