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
- The topic ‘Multiple Loop Not resetting’ is closed to new replies.