WP_Query only returns 10 items
-
Hey everyone–having a slight issue: my WP_Query() function is only returning 10 pages and/or posts even though there are many more. I can’t figure it out!
$my_wp_query = new WP_Query(); $all_wp_pages = $my_wp_query->query(array('post_type' => 'page'); for ($r = 0; $r < count($all_wp_pages); $r++){ echo ' <!--'. print_r($all_wp_pages[$r]) .'-->'; }Here’s a snippet of code where I’m getting the issue–It’s only returning the 10 LATEST posts or pages made. If I make a new ‘page’ then it will be returned at the top of the returned list, but the oldest one in the list will get pushed out and not be in the list anymore. I’m super confused why this is happening.
Thanks guys!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘WP_Query only returns 10 items’ is closed to new replies.