How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
The simplest solution would be to query all posts using a -1 in place of the 12 in your ‘posts_per_page’ argument of your query. Then use a counter that ticks up if all of the above conditions equal true. $args = array( ‘post_type’ => $post_slug, ‘posts_per_page’ => -1, ‘paged’ => 1, ‘post_status’ => ‘publish’, ); … Read more