Title: Multiple loop&#8230; big problem
Last modified: August 19, 2016

---

# Multiple loop… big problem

 *  Resolved [MrKid](https://wordpress.org/support/users/mrkid/)
 * (@mrkid)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/multiple-loop-big-problem/)
 * Hi,
    i have some problem with the multiple loop!
 * My theme has 3 columns; in my left column there is this code for 5 categories:
 *     ```
       <?php require('wp-blog-header.php'); ?>
       <?php query_posts('showposts=1&cat=39'); global $more; $more = 1; while (have_posts()) : the_post(); ?>
   
       <a href="<?php the_permalink() ?>" rel="bookmark" title="Permalink a <?php the_title(); ?>"><?php the_title(); ?></a>
   
       <?php the_content_rss('', false, '', 20); ?>
       <?php endwhile; ?>
       ```
   
 * in the central column there is this code:
 *     ```
       <?php if (have_posts()) : ?>
       <?php while (have_posts()) : the_post(); ?>
   
       <?php the_time('l, j M, Y') ?><?php comments_popup_link('0', '1', '%'); ?>
   
       <h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title() ?></a></h2>
       <h5>Categories: <?php the_category(', '); ?></h5>
       <?php the_excerpt(''); ?>
       ```
   
 * The problem is in the second column, because it doesn’t visualize the articles,
   but only the same article of the first column.
 * Could you help me with this code???
    Thanks a lot

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

 *  [iridiax](https://wordpress.org/support/users/iridiax/)
 * (@iridiax)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/multiple-loop-big-problem/#post-935212)
 * See: [http://codex.wordpress.org/The_Loop#Multiple_Loops](http://codex.wordpress.org/The_Loop#Multiple_Loops)
 *  [SimonJ](https://wordpress.org/support/users/simonj/)
 * (@simonj)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/multiple-loop-big-problem/#post-935214)
 * Your problem is that when you call your second loop in your central column, the
   first query posts from your left column is still active… This query_posts still
   ask worpress to show one post from category 39.
 * the solution is to add this line :
 * `<?php wp_reset_query(); ?>`
 * Right after your `<?php endwhile; ?>` in the left column…
 * It should do the trick
 * S.
 *  Thread Starter [MrKid](https://wordpress.org/support/users/mrkid/)
 * (@mrkid)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/multiple-loop-big-problem/#post-935386)
 * Ohhhhhhhhhhhhhhhhh
    Thanks a lot guys !!!! SimonJ i have used your solution and
   with the “wp_reset_query” is all ok! thanks thanks thank

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

The topic ‘Multiple loop… big problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [MrKid](https://wordpress.org/support/users/mrkid/)
 * Last activity: [17 years, 5 months ago](https://wordpress.org/support/topic/multiple-loop-big-problem/#post-935386)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
