scriptygoddess

04 Sep, 2004

Limit drop down comments

Posted by: Jennifer In: WordPress: Lessons Learned

I'm kind of surprised I didn't post this already (maybe I did and I just can't find it) – but on another blog, I have drop down comments set so it only does this for the first 'x' number of posts with comments. (Otherwise download times can get a little bogged down if there's a lot of posts with comments on the page…) To do that I have this at the top of my page:

<?php
$showcommentmax = 3;
$currentshowcomment = 0;
?>

Then I have this code around the drop down comments call:

<?php
if ($showcommentmax > $currentshowcomment) {
include(ABSPATH . 'wp-dropdown-comments.php');
if (get_comments_count() > 0) {
$currentshowcomment++;
// only counting show comment if it there are comments to show
}
}
?>

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

2 Responses to "Limit drop down comments"

1 | Jennifer

September 6th, 2004 at 4:19 pm

Avatar

Well, I did kind of post this already, but it was MT specific… so I'll leave this post up since it's WP specific.

2 | Mark J

September 12th, 2004 at 2:29 am

Avatar

Very cool. I don't think I've ever gotten a large number of comments while an entry was still on the front page, but it never hurts to be prepared. ;-)

Featured Sponsors


  • Curt: If anyone comes across this with similar issues I was able to sort out the pagination issues painlessly with easyCommentsPaginate from http://www.mush
  • Christopher: Yeah, it is indeed hard to do. And something remains elusive about why the pagination never worked. I tried everything I could find. Regardless, I
  • Jennifer: Hi Christopher, always hard to bug test stuff like that remotely. Sorry those didn't help. Glad you found a solution though :)

About


Advertisements