Change Amount of 'Recent Comments' in Drupal

Jun
13

I was setting up the new 'Recent Comments' block on the front page today. It was initially showing 10 comments, the default Drupal amount, but this was too much it was just cluttering. So I found a way to change the default number, it's a bit messy but it works. Here's how to do it:

Open the comment.module file, located in the modules folder in your drupal home directory. In your text editor around line 300 you will see a line that reads

function comment_get_recent($number = 10)

Change the 10 to whatever number of comments you want to show, I used 5 so mine looks like

function comment_get_recent($number = 5),

Save the file, and now 5 comments will show instead of the default 10.


Trackback URL for this post:

http://elfknowsit.com/trackback/80

2 comments

Elf Guest (not verified)

I heard this will be a feature in Drupal 7? Is this true?

The Elf's picture

I heard this too, I saw some development talk on Drupals site, http://drupal.org about it too. It will be handy to be able to change it without messing with code.

Post new comment

CAPTCHA
Sorry, Have to ask
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.