Showing all the posts in one page?

This is what I would consider the correct solution, and is the solution alluded to by Milo’s comment (if I am not mistaken).

function alter_ppp_for_tags_wpse_88337($qry) {
  if ( is_tag() && $qry->is_main_query() ) {
    $qry->set('posts_per_page','-1');
  }
}
add_action('pre_get_posts','alter_ppp_for_tags_wpse_88337');

Using query_posts will cause two requests to the database– the main query, and the query triggered by the use of query_posts. By using a filter on pre_get_posts you alter the main query before posts are fetched and thus only hit the database once.

Reference:

http://codex.wordpress.org/Class_Reference/WP_Query

Leave a Comment