Title: query_posts not returning all posts
Last modified: August 19, 2016

---

# query_posts not returning all posts

 *  Resolved [jwburnside](https://wordpress.org/support/users/jwburnside/)
 * (@jwburnside)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/query_posts-not-returning-all-posts/)
 * Hey everyone, I seem to be having a problem with the results of my query_posts
   results. I am simply putting the results in an array, but only 10 of my 14 posts
   seem to be coming through, with the older posts being ignored. Anyone seen this
   before, or am I doing something wrong? Here is the important portion:
 * <?php query_posts(“cat=7”); ?>
    <?php while (have_posts()) : the_post(); ?>
 * <?php //put the post data into an array
    $customField = get_post_custom_values(‘
   Front Page Image’); $postarray[$postkey] = array( “title” => get_the_title(),“
   perm” => get_permalink(), “frontimage” => $customField[0], “excerpt” => get_the_excerpt());
   echo “<span style=’position:absolute;color:white;’> ” . count($postarray) . ”
   </span>”; ?>
 * The echo displays the element count of the array, but like I mentioned it only
   goes to 10 for some reason.
 * Thanks for the help,
 * JW

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/query_posts-not-returning-all-posts/#post-1346132)
 * `<?php query_posts("posts_per_page=-1&caller_get_posts=1&cat=7"); ?>`
 * Related:
    [query_posts()](http://codex.wordpress.org/Template_Tags/query_posts)
 *  Thread Starter [jwburnside](https://wordpress.org/support/users/jwburnside/)
 * (@jwburnside)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/query_posts-not-returning-all-posts/#post-1346194)
 * Thanks, I seemed to have over-looked that one.
 * JW

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

The topic ‘query_posts not returning all posts’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [jwburnside](https://wordpress.org/support/users/jwburnside/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/query_posts-not-returning-all-posts/#post-1346194)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
