Title: My theme loop hides posts
Last modified: August 20, 2016

---

# My theme loop hides posts

 *  Resolved [marcelu80](https://wordpress.org/support/users/marcelu80/)
 * (@marcelu80)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/my-theme-loop-hides-posts/)
 * Hi there,
 * I run a corporate blog with a theme called pinnacle. It was only recently that
   I found out that The loop is hiding posts, one of every 4 to be precise. Here
   is a demo of my theme where you can see this loop in action ([http://wpthemedesigner.com/demo/index.php?wptheme=Pinnacle+Theme](http://wpthemedesigner.com/demo/index.php?wptheme=Pinnacle+Theme)).
   As you can see, it has one featured article and then two columns where the loop
   is called. The problem is that there is one hiden post between the las post on
   the left column and the first on the right.
 * I’ve gone through it many times but any change made no difference. I know is 
   a basic loop management issue, but I’m not skilled programmer… well I’m no programmer
   at all :-P. Any ideas? Thanks for your help.
 * `<div class="l division">`
 *  <?php
    if (have_posts()) : $count = 0; while(have_posts()) : the_post(); $count
   ++; if ($count>4) break; ?>
 *  <!-- begin post -->
    <div class="post"> <h2>"><?php the_title(); ?></h2> <p 
   class="details"><?php the_time('F j, Y') ?>   |  <?php comments_popup_link(__('
   Leave a comment'), __('1 Comment'), __('% Comments')); ?></p> "><?php dp_attachment_image(
   $post->ID, 'thumbnail', 'class="' . $post->post_title . '"'); ?> <?php the_excerpt();?
   > </div> <!-- end post -->
 *  <?php endwhile; endif; ?>
 *  </div>
 * The right column is identical except for the layout.

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/my-theme-loop-hides-posts/#post-2274568)
 * can you paste the full code of that template into a [http://pastebin.com/](http://pastebin.com/)
   and post the lik to it here?
 * imho, as far as i can see from the posted code section, the problem lies with:
 *     ```
       $count++;
       if ($count>4) break;
       ```
   
 * i.e. breaking out of the loop after the next post was called;
 * possibly, try to move these two lines to just before the `endwhile;` and possibly
   change 4 to 3.
 *  Thread Starter [marcelu80](https://wordpress.org/support/users/marcelu80/)
 * (@marcelu80)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/my-theme-loop-hides-posts/#post-2274588)
 * Certainly! Here you are [http://pastebin.com/kmJ7fW39](http://pastebin.com/kmJ7fW39)
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/my-theme-loop-hides-posts/#post-2274589)
 * try this:
 * [http://pastebin.com/b7apZz3E](http://pastebin.com/b7apZz3E)
 * as i suggested earlier, the ‘break’ section is rearranged to just before the ‘
   endwhile’.
 *  Thread Starter [marcelu80](https://wordpress.org/support/users/marcelu80/)
 * (@marcelu80)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/my-theme-loop-hides-posts/#post-2274591)
 * Wow mate, that worked wonders!
    Solved it straight away. Thanks a lot!!!

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

The topic ‘My theme loop hides posts’ is closed to new replies.

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [marcelu80](https://wordpress.org/support/users/marcelu80/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/my-theme-loop-hides-posts/#post-2274591)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
