Custom post type archive not regarding ‘posts_per_page’ => -1
WP_Query is for secondary loops. That is to say that it’s completely independent from the page’s default $wp_query. I suspect that it’s not working because you aren’t referencing your new WP_Query object on the loop. To do that, you’d do this: if( $all_sports->have_posts() ) : while( $all_sports->have_posts() ) : $all_sports->the_post(); // do stuff endwhile; endif; … Read more