Display posts with comments closed, with pagination?

i’m using a custom query, which needs to display all posts with closed comments.

I have this

Read More
<?php $the_query = new WP_Query('showposts=-1'); ?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>

<?php if (!comments_open()) : ?>
//some posts fomatting
<?php endif; ?>

<?php endwhile;?>

So, basically, this loops through all posts, and then displays only the ones with the closed comments.

It works, but i want to introduce the pagination to it. If i say posts_per_page instead of showposts, it doesn’t work.

Any help would be appreciated :).

Related posts

Leave a Reply