Title: multiple loops rewind_posts question
Last modified: August 20, 2016

---

# multiple loops rewind_posts question

 *  Resolved [nielz](https://wordpress.org/support/users/nielz/)
 * (@nielz)
 * [15 years ago](https://wordpress.org/support/topic/multiple-loops-rewind_posts-question/)
 * Hi there,
 * I am working on a site where I want to use multiple loops to request (Flutter)
   data.
    I use the folowing code several times to load data in multiple columns:
 *  <?php
    query_posts(‘category_name=item1’); if(have_posts()) : while(have_posts()):
   the_post(); echo get(‘column1’); endwhile; endif; ?>
 * This code works fine now but I read that you maybe should use <?php rewind_posts();?
   > before each new loop on the same page.
    Does anybody now if this is necessary
   and why?
 * Regards,
 * Niels

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years ago](https://wordpress.org/support/topic/multiple-loops-rewind_posts-question/#post-2136647)
 * you would use ‘rewind_posts()’ if you want to re-use the same query for the second
   loop;
    it is neither needed nor useful if you use a new query for the second 
   loop.
 * for other than the main loop, it is advisable to use `WP_Query()` or `get_posts()`.
 * in case you haven’t read this yet, general info:
    [http://codex.wordpress.org/The_Loop](http://codex.wordpress.org/The_Loop)
 *  Thread Starter [nielz](https://wordpress.org/support/users/nielz/)
 * (@nielz)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/multiple-loops-rewind_posts-question/#post-2136806)
 * Thanks!

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

The topic ‘multiple loops rewind_posts question’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [nielz](https://wordpress.org/support/users/nielz/)
 * Last activity: [14 years, 12 months ago](https://wordpress.org/support/topic/multiple-loops-rewind_posts-question/#post-2136806)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
