Title: Only one post shows
Last modified: August 18, 2016

---

# Only one post shows

 *  Resolved [awfief](https://wordpress.org/support/users/awfief/)
 * (@awfief)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/only-one-post-shows/)
 * Hi there,
 * I’m using WordPress 1.5.1 at [http://www.biresource.org](http://www.biresource.org),
   and as you can see from the link, only one post shows up. However, if you check
   out the side links, there are MANY headlines, in July, June, etc. Clicking on
   them works.
 * I’m confounded as to why this is. I’ve checked the SQL (by using an echo statement
   and typing that into MySQL) and it’s correct, it gets 10 records. In fact, if
   you view source on biresource.org, you can see that the first HTML that’s there
   is:
 * <!– 10 –>
 * which is an echo of count($posts) that I put in. So even after the query runs,
   the # of posts is 10. The echo statement is the line before the foreach statement:
 * <CODE>
    <div id=”content”> <?php echo “<!– ” . count($posts) . “–>”; ?> <?php
   if ($posts) : foreach ($posts as $post) : start_wp(); ?> </CODE>
 * It displays the first post perfectly, and then ends by exiting normally. The 
   code at the end of the post is:
 * <CODE><?php comments_template(); ?>
    <img src=”[http://www.biresource.org/images/rainbow_line.gif&#8221](http://www.biresource.org/images/rainbow_line.gif&#8221);
   alt=”(rainbow line) ” vspace=4 hspace=20 height=4 width=100%> <?php echo “<!–“.
   count($posts) . “–>”; ?> <?php endforeach; else: ?> <?php _e(‘Sorry, no posts
   matched your criteria.’); ?> <?php endif; ?> </CODE>
 * Note the echo of count($posts) again — if you view source on [http://www.biresource.org](http://www.biresource.org),
   and search for “rainbow_line” you’ll see that <!– 1 –> is in the HTML source —
   that’s the count of $posts at the end.
 * This is obviously the problem, that the query is correct and gets 10 posts, but
   somehow in the foreach loop, the $posts array loses the rest of the posts. . .
   $posts isn’t referred to in between, and I can’t think of what I’d done or anything.
 * Please help if you can. I’m happy to send files and code and such. Thank you 
   in advance.

Viewing 1 replies (of 1 total)

 *  Thread Starter [awfief](https://wordpress.org/support/users/awfief/)
 * (@awfief)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/only-one-post-shows/#post-240124)
 * Aha!
 * I found the problem — I was using viewlevel as a plugin, and I’d made at least
   9 protected posts. So it was retrieving all the posts, they just were protected.

Viewing 1 replies (of 1 total)

The topic ‘Only one post shows’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [awfief](https://wordpress.org/support/users/awfief/)
 * Last activity: [20 years, 9 months ago](https://wordpress.org/support/topic/only-one-post-shows/#post-240124)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
