Title: multiple loops causing problems
Last modified: August 19, 2016

---

# multiple loops causing problems

 *  [dbokser](https://wordpress.org/support/users/dbokser/)
 * (@dbokser)
 * [18 years ago](https://wordpress.org/support/topic/multiple-loops-causing-problems/)
 * I have a site where the main page is split into 5 columns. The first 4 columns
   display a specific category and they do it using:
 *     ```
       <?php echo get_cat_name(6); ?>
       <?php if (have_posts()) : ?>
       <?php query_posts('cat=6&showposts='.get_option('posts_per_page')); ?>
       <? while (have_posts()) : the_post(); ?>
       <!--- STUFF ---!>
       <?php endwhile; endif; ?>
       ```
   
 * I’ve ran through the Loop section on the codex and stored the original post query
   before all of these columns using
 *     ```
       <?php $temp_query = $wp_query; ?>
       <!--- 4 Columns ---!>
       <?php $wp_query = $temp_query; ?>
       ```
   
 * after the last bit, I put in my 5th column where I want all of the posts. What
   happens, though, is that it only displays the posts from the 4th column. I’ve
   also tried using <?php rewind_posts(); ?> to no avail.
 * Is there anything else I should be trying to get it to work?

The topic ‘multiple loops causing problems’ is closed to new replies.

## Tags

 * [multiple loops](https://wordpress.org/support/topic-tag/multiple-loops/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [dbokser](https://wordpress.org/support/users/dbokser/)
 * Last activity: [18 years ago](https://wordpress.org/support/topic/multiple-loops-causing-problems/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
