• Hi,
    I was trying to get pages with wp_query. $query->found_posts is returning 14 where the loop is exiting after 10 posts. I’ve tried many ways to get all pages, but I’m completely lost.

    Any help would be great. Thanks.

Viewing 1 replies (of 1 total)
  • As similar post drew a couple of solutions:

    10 is the default number of posts to display and can be changed under Settings/Reading in wp-admin.

    For a specific template, include “posts_per_page=-1” in your query.

    e.g. $posts = query_posts( "tag=$tag&order=asc&posts_per_page=-1" );

Viewing 1 replies (of 1 total)
  • The topic ‘wp_query is not showing all posts’ is closed to new replies.