Title: Loop breaking need help
Last modified: August 19, 2016

---

# Loop breaking need help

 *  [ket](https://wordpress.org/support/users/ket/)
 * (@ket)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/loop-breaking-need-help/)
 * Hello,
 * I’m am using two loops in the homepage, let say featured post and normal posts,
   and looking for solution for my problems.
 * Using this layout, I would need two loops to make it run properly. My problem
   is: when I break the first loop with theses codes:
 *  <?php static $ctr = 0;
    if ($ctr == “1”) { break; } else { ?>
 *  <?php $ctr++; } ?>
 * There’s a featured post section as I want. But, instead of begin with the second
   most recent post, the second loop shows the third recent post as the first post.
 * Any help would be appreciated. And sorry for my bad English. And I hope I make
   myself clear.
 * Thanks

Viewing 1 replies (of 1 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/loop-breaking-need-help/#post-670923)
 * You may be better off just testing off the $posts object (and current $post) 
   in The Loop for this, instead of building a counter. So in the first loop:
 * `<?php if( $posts[0] != $post ) { break; } ?>`
 * In your second loop, do something like:
 *     ```
       <?php if( $posts[0] != $post ) { ?>
   
       ~Display post~
   
       <?php } ?>
       ```
   
 * And your English is fine. `;)`

Viewing 1 replies (of 1 total)

The topic ‘Loop breaking need help’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * Last activity: [18 years, 5 months ago](https://wordpress.org/support/topic/loop-breaking-need-help/#post-670923)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
