The answer is there in that page.
You basically have a few different options on how to implement this depending on the order in which you want to run the multiple loops:
- Main post loop first followed by asides loop
- Asides loop first followed by main post loop
For 1, you can do the following after running the normal loop where you want you asides loop you call query_posts
to get the list of aside posting using the following code:
// Get the last 5 posts in the asides_cat category.
<?php query_posts('category_name=asides_cat&showposts=5'); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- Do asides stuff... -->
<?php endwhile;?>
For 2, which I think is what you want from your description you need to be a little more careful. If you call query_posts
for the asides loop before displaying the normal loop it will overwrite the normal loops query and you won’t be able to display it easily. Therefore you have to create a new query object and use that as follows:
<?php $my_query = new WP_Query('category_name=asides_cat&showposts=5'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<!-- Do asides_cat stuff... -->
<?php endwhile; ?>
You can then run your normal loop after this one for the asides.
Both these examples come from the codex docs The_Loop#Multiple_Loops_Example_1.