Title: Help with Loop and Multiple Styles
Last modified: August 20, 2016

---

# Help with Loop and Multiple Styles

 *  [sundayx](https://wordpress.org/support/users/sundayx/)
 * (@sundayx)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/help-with-loop-and-multiple-styles/)
 * _As a premise I need to mention that I’m not a programmer or developer, so my
   technical knowledge of getting it working is fairly limited. That being said,
   I’ve been looking around to get the right type of code (with some tweaking) to
   get it to work, but no dice. I’ve also tried searching for a solution throughout
   the forum._
 * I think the problem is better understood with [a diagram](http://dl.dropbox.com/u/4027438/diagram.jpg)
   of what I’m trying to achieve. Here’s also [a screenshot](http://dl.dropbox.com/u/4027438/screen.png)
   to show exactly what it looks like (you can see how the post is repeated already).
 * The majority of the problem I have seems to be that there are 3 different post
   layouts that I’m trying to integrate into the loop: 1) the feature carousel at
   the top, 2) the middle section with the posts being vertical, and 3) the rest
   of the posts in horizontal below.
    - Posts can’t appear twice on the page
    - The following pages will be a different layout (only the homepage to appear
      in this layout)
 * I’ve actually posted the question [here](http://www.neowin.net/forum/topic/1055136-wordpress-loop-help/)
   with the full code if it might help. Thank you your help is much appreciated.

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

 *  Thread Starter [sundayx](https://wordpress.org/support/users/sundayx/)
 * (@sundayx)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/help-with-loop-and-multiple-styles/#post-2541242)
 * One day bump.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/help-with-loop-and-multiple-styles/#post-2541243)
 * See [multiple Loops](http://codex.wordpress.org/The_Loop#Multiple_Loops).
 *  Thread Starter [sundayx](https://wordpress.org/support/users/sundayx/)
 * (@sundayx)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/help-with-loop-and-multiple-styles/#post-2541251)
 * Believe me I’ve looked through that through and through but I’m desperately stuck.
 * So what I did was break it down to the raw basics, this is what I have, meaning
   also that I’ve done the first 2 parts. What’s left for me is to return the rest
   of the posts (and not duplicate to what’s being shown already) and this is where
   I have completely no clue.
 * Please help.
 *     ```
       <?php $my_query = new WP_Query('tag=starred&posts_per_page=5');
         while ($my_query->have_posts()) : $my_query->the_post();
         $do_not_duplicate[] = $post->ID ?>
       <!-- do carousel stuff -->
       <?php endwhile; ?>
   
       <?php query_posts(array('post__not_in'=>$do_not_duplicate, 'posts_per_page'=>4));
        if (have_posts()) : while (have_posts()) : the_post();
        ?>
        <!-- do loop stuff -->
       <?php endwhile; endif; ?>
       ```
   
 * _[Please post code or markup snippets between backticks or use the code button.]_
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/help-with-loop-and-multiple-styles/#post-2541261)
 * the code looks ok – where directly is the problem, and can you post a link to
   your site to illlustrate the output of the above code?
 * just keep going with a third loop – integrate the `$do_not_duplicate[]` into 
   the second loop, and use ‘post__not_in’ again in the third loop …
 *  Thread Starter [sundayx](https://wordpress.org/support/users/sundayx/)
 * (@sundayx)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/help-with-loop-and-multiple-styles/#post-2541271)
 * Thanks alchymyth. The problem is I have no idea to create the third loop that
   continues the second. This is what I have, I know exactly what’s wrong with it(
   the 3rd loop is running through the query again and returning the 4 posts once
   again from the 2nd loop) but I have no idea how I can tackle it. Thank you.
 * _[[code moderated ](http://codex.wordpress.org/Forum_Welcome#Posting_Code)– please
   use the [pastebin ](http://pastebin.com/)for any code over 10 lines]_
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/help-with-loop-and-multiple-styles/#post-2541283)
 * [http://pastebin.com/uxYHHtyh](http://pastebin.com/uxYHHtyh)
 *  Thread Starter [sundayx](https://wordpress.org/support/users/sundayx/)
 * (@sundayx)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/help-with-loop-and-multiple-styles/#post-2541296)
 * Anyone?

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

The topic ‘Help with Loop and Multiple Styles’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [sundayx](https://wordpress.org/support/users/sundayx/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/help-with-loop-and-multiple-styles/#post-2541296)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
