How to ensure WordPress template tags work properly when using multiple WordPress Loops
Tuesday, 8th December 2009There are many occasions when you may want to create multiple WordPress Loops – instructions on how to do this can be found on the WordPress Codex.
If you need to keep the original query, it is suggested you create you second loop by creating a new query object.
<?php $my_query = new WP_Query('category_name=special_cat&posts_per_page=10'); ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <!-- Do special_cat stuff... --> <?php endwhile; ?>
This works fine, but if you use more template tags after this loop, they display the content from the last post in the $my_query loop. So, if you want to reference the original loop how should you go about it?

