Is this problem solved already. I would like this plugin but the article title must be in it.
Thread Starter
Summer
(@fpmsummer)
I poked around in the plugin code, and modified the line that prints the output to get what I wanted, which was the comment author, followed by the link to the comment with the post name, followed by the snippet of comment (which I increased to 75 chars)
Just edit the plugin file wp-recent-comments-with-avatars.php, look for the comment that starts with “translators”, and replace the sprintf statement.
This is what I changed it to, and it works on two sites I modified the plugin on:
/* translators: comments widget: 1: comment author, 2: post link, 3: comment text */
sprintf(_x('%1$s on %2$s: %3$s', 'widgets'),'<b>'. get_comment_author(). '</b>:',' <a href="' . esc_url( get_comment_link($comment->comment_ID) ). '">' . get_the_title($comment->comment_post_ID) . '</a>', trim(mb_substr(strip_tags($comment->comment_content), 0, 75))) . '</li>';
Hope this helps others!
Just wanted to verify that the code published by FPM does work. However, in my case, showing the post titles made the recent comments too long. Instead, I just removed the word ON in the code and now I have something i like.
Thread Starter
Summer
(@fpmsummer)
Hi Jeff! (I’ve commented on WP Tavern as just Summer)
I was worried about the length of the comments as well, mostly because I’d increased it from the default 50 chars to 75 chars.
So far, one thing I’ve noticed is that having the post titles has encouraged a few more drive-by commenters when they can see what the topic is they’re commenting on, so I’m inclined to leave it for now (especially since several of the sites I’ve implemented this on have wider sidebars).
I dunno, maybe I’m just encouraging the random argumentative types, but so far it hasn’t raised any complaints about them yet.
I’m also just tickled I figured out the strings and get it to work 🙂