Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

I have this

<?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 :).

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.