Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 112716

keesiemeijer on "Showing More Posts When Using Categories"

$
0
0

put this in your theme's functions.php If you want to show all posts on category pages:

function my_post_queries( $query ) {
  // not an admin page and is the main query
  if (!is_admin() && $query->is_main_query()){
    if(is_category()){
      $query->set('nopaging', 1);
    }
  }
}
add_action( 'pre_get_posts', 'my_post_queries' );

Viewing all articles
Browse latest Browse all 112716

Trending Articles