Title: Multiple Loop Not resetting
Last modified: August 19, 2016

---

# Multiple Loop Not resetting

 *  Resolved [mvlaver](https://wordpress.org/support/users/mvlaver/)
 * (@mvlaver)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/multiple-loop-not-resetting/)
 * Hi guys hope you can help with this.
 * I have two loops in my sidebar to show latest newsletter and latest podcast.
 * This is the first one
 *     ```
       <?php $latestnewsletters = new WP_query('showposts=1&category=5'); ?>
       	<?php while ($latestnewsletters->have_posts()) : $latestnewsletters->the_post(); ?>
       		<li class="newsletter"><a href="<?php echo get_post_meta($post->ID, 'newsletter_pdf', true ); ?>">Newsletter from <?php the_title(); ?></a></li>
       	<?php endwhile; ?>
       ```
   
 * Which is followed directly by
 *     ```
       <?php $latestpodcast = new WP_query('showposts=1&category=3'); ?>
       	<?php while ($latestpodcast->have_posts()) : $latestpodcast->the_post(); ?>
       		<li class="podcast"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
       	<?php endwhile; ?>
       ```
   
 * The problem is that the second loop is showing the results of the first one. 
   i.e. the_title of the second one is showing me a title from the first one.
 * Anybody know what I am doing wrong. Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/multiple-loop-not-resetting/#post-1537287)
 * try to use `<?php wp_reset_query(); ?>` after each loop.
 *  Thread Starter [mvlaver](https://wordpress.org/support/users/mvlaver/)
 * (@mvlaver)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/multiple-loop-not-resetting/#post-1537515)
 * Didn’t help I’m afraid. Any other suggestions?
 *  Thread Starter [mvlaver](https://wordpress.org/support/users/mvlaver/)
 * (@mvlaver)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/multiple-loop-not-resetting/#post-1537516)
 * All right I’m just being an idiot sorry to waste your time. It’s because there
   isn’t such a parameter as ‘category’. It should be ‘cat’. Which means both queries
   were just giving me the same result from the pages initial query – rahr!
 * Oh well hope this helps someone.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Multiple Loop Not resetting’ is closed to new replies.

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [the-loop](https://wordpress.org/support/topic-tag/the-loop/)

 * 3 replies
 * 2 participants
 * Last reply from: [mvlaver](https://wordpress.org/support/users/mvlaver/)
 * Last activity: [15 years, 12 months ago](https://wordpress.org/support/topic/multiple-loop-not-resetting/#post-1537516)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
