Title: Multiple loops
Last modified: August 19, 2016

---

# Multiple loops

 *  [eggiog](https://wordpress.org/support/users/eggiog/)
 * (@eggiog)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/multiple-loops-2-2/)
 * Hi and please sorry for my english.
    In my blog I use a layout with 3 different
   loops in home page. The main one, displays the latest post (so without a query_post
   tag), while each side loop returns the latest post from a specified category,
   using a query_post tag. Now, the problem is: if the latest “general” post belongs
   to a side loop category, that post will be shown twice, both in main and side
   loop. Is there a way to exclude from the side loops the latest post currently
   displayed in the main one? I hope I’ve been clear. I really appreciate an hint.
   Thanks to all. h.

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

 *  [magickwolf78](https://wordpress.org/support/users/magickwolf78/)
 * (@magickwolf78)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/multiple-loops-2-2/#post-667867)
 *     ```
       <?php query_posts('category_name=YOUR CAT NAME&showposts=1&offset=001'); ?>
   
         <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
       ```
   
 * offset=001 can be set to any number that you like 002,003, etc.. This will show
   the second newest,third, etc. post in a particular category.
 * Hopefully this is what you are looking for?
 *  Thread Starter [eggiog](https://wordpress.org/support/users/eggiog/)
 * (@eggiog)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/multiple-loops-2-2/#post-667868)
 * Not really,
    In that way, if the newest post in the category is not shown in 
   the main loop, will be not displayed in the side loop too, right? :\ I think 
   I have to give up >_<
 *  [magickwolf78](https://wordpress.org/support/users/magickwolf78/)
 * (@magickwolf78)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/multiple-loops-2-2/#post-667887)
 * This; offset=001 only only skips one. If it reads offset=002 it will skip the
   first two posts. and so on.. Something that may be required, you may have to 
   reset the loop before you begin the loop in the side bar. It will look like this:
 *     ```
       <?php rewind_posts(); ?> 
   
         <?php query_posts('category_name=YOUR CAT NAME&showposts=1&offset=001'); ?>
   
         <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
       ```
   
 * The rewind snip basically starts the loop or call to the db , the next snip of
   code tells wordpress where to look for the post, how many to show, and where 
   to start in the cat.
    then the loop tells wordpress if you got a post under that
   criteria since you have found it, post it.
 * I hope this help I will try to find out more for you

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

The topic ‘Multiple loops’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [magickwolf78](https://wordpress.org/support/users/magickwolf78/)
 * Last activity: [18 years, 5 months ago](https://wordpress.org/support/topic/multiple-loops-2-2/#post-667887)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
