Fixed number of posts without pagination if ( $query->is_main_query() && ! is_admin() && $query->is_post_type_archive( 'portfolio' ) ) { $query->set( 'posts_per_page', 12 ); $query->set( 'no_found_rows', 'true' ); }