Title: Movenext in loop without counting
Last modified: August 19, 2016

---

# Movenext in loop without counting

 *  [jdku](https://wordpress.org/support/users/jdku/)
 * (@jdku)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/movenext-in-loop-without-counting/)
 * Hi all,
    not sure if this is possible or not but here’s what I’m trying to do:
   I have:
 *     ```
       <?php elseif (in_category(48)) : ?>
       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       ```
   
 * …etc, etc
 * This loops through 10 times and outputs in 2 lines of output with the post excerpt
   etc.
 * What i’m trying to do is exclude posts from certain categories within the loop,
   which is easy enough, but i DON’T want the loop to count. i.e. it outputs 4 then
   comes across one I want to exclude and it skips over it but will still output
   a further 6.
 * at the moment it’s looping through and just showing 9 as i’m skipping one because
   I don’t want to display, which is half-right.
 * Hope i’ve explained that ok!

Viewing 16 replies (of 16 total)

[←](https://wordpress.org/support/topic/movenext-in-loop-without-counting/?output_format=md)
[1](https://wordpress.org/support/topic/movenext-in-loop-without-counting/?output_format=md)
2

 *  Thread Starter [jdku](https://wordpress.org/support/users/jdku/)
 * (@jdku)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/movenext-in-loop-without-counting/page/2/#post-1870927)
 * absolute genius!! works like a charm thank you so much!

Viewing 16 replies (of 16 total)

[←](https://wordpress.org/support/topic/movenext-in-loop-without-counting/?output_format=md)
[1](https://wordpress.org/support/topic/movenext-in-loop-without-counting/?output_format=md)
2

The topic ‘Movenext in loop without counting’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 16 replies
 * 3 participants
 * Last reply from: [jdku](https://wordpress.org/support/users/jdku/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/movenext-in-loop-without-counting/page/2/#post-1870927)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
