Title: Gap left from deleted post when using query posts
Last modified: August 18, 2016

---

# Gap left from deleted post when using query posts

 *  [andyt963](https://wordpress.org/support/users/andyt963/)
 * (@andyt963)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/gap-left-from-deleted-post-when-using-query-posts/)
 * Hey all
 * I am using a query posts call:
 *     ```
       <?php
       query_posts('showposts=10');
       ?>
       	<?php if (have_posts()) : ?>
       	<?php while (have_posts()) : the_post(); ?>
       	<?php if (!in_category('8') ): ?>
       	<?php if (!in_category('7') ): ?>
       ```
   
 * to call the last 10 posts from certain categories.
 * Problem is that I have deleted some posts and it seems to leave a gap in my layout
   where the deleted post should be instead of showing the next post.
 * Does anyone know how to work around this and just show the latest posts?
 * Also is there a function to call 10 posts from several chosen categories and 
   then be able to call 10 posts from other categories below it?
 * Using the query posts code above only shows 10 posts total on the page instead
   of each time.
 * Hope that made sense and someone can help me out.

The topic ‘Gap left from deleted post when using query posts’ is closed to new replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [gap](https://wordpress.org/support/topic-tag/gap/)
 * [queryposts](https://wordpress.org/support/topic-tag/queryposts/)
 * [space](https://wordpress.org/support/topic-tag/space/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [andyt963](https://wordpress.org/support/users/andyt963/)
 * Last activity: [19 years, 2 months ago](https://wordpress.org/support/topic/gap-left-from-deleted-post-when-using-query-posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
