Title: 3 Loop System
Last modified: August 19, 2016

---

# 3 Loop System

 *  [GeorgeOz](https://wordpress.org/support/users/georgeoz/)
 * (@georgeoz)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/3-loop-system/)
 * Hi there, I am currently trying to get a 3 loop system working on my theme.
 * I am getting a few problems.
 * This is how I want it:
 * **Home Page:**
    _Loop 1_ – Featured post, 1 Post (from Featured Category only)
 * _Loop 2_
    – Latest Posts, 4 Posts (All remaining posts except Featured and Resources
   cat)
 * _Loop 3_
    – Latest Resources, 4 Posts (from Resources Category only)
 * Here is my Loops:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * The problem I am getting is the 3rd loop is showing posts from the resources 
   category BUT the 2nd loop is also showing the resources posts I need the 2nd 
   post to not duplicate either 1st or 2nd loop.
 * If that make sense? lol
 * Hope someone can help, thanks.
 * George

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

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/3-loop-system/#post-1949371)
 * In the first 2 loops, add the ID of the current post to an array, something like
   this (UNTESTED):
 * `$seen = array(); // Put this before the first loop`
 * Use code like this to add the current post ID to the array:
 *     ```
       if (have_posts()) {
          while (have_posts()) {
             the_post();
             $seen[] = $post->ID;
       ```
   
 * Then, in the third loop, add the post_not_in argument with the IDs:
 *     ```
       $args = array(
          'cat' = 44,  // the category id of Resources
          // add your other arguments here
       );
       $ids = implode(',',$seen);
       if ($ids) $args['post_not_in'] = $ids;
       query_posts($args);
       ```
   
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/3-loop-system/#post-1949397)
 * _[dupe: [http://wordpress.org/support/topic/how-to-have-3-loops-on-my-theme?replies=6](http://wordpress.org/support/topic/how-to-have-3-loops-on-my-theme?replies=6)_
 * [http://codex.wordpress.org/Forum_Welcome#Where_To_Post](http://codex.wordpress.org/Forum_Welcome#Where_To_Post)
 * please continue withyour first thread.]

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

The topic ‘3 Loop System’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/3-loop-system/#post-1949397)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
