![]() |
I want to put the [[LINK href="http://wordpress.org/extend/plugins/user-photo/"]]User Photo[[/LINK]] into the widget of recent comments which is made with this [[LINK href="http://wordpress.org/extend/plugins/get-recent-comments/"]]plugin[[/LINK]].
I could not figure out any other way to get two plugins together, which harmonize.
As i suggest, one has two write a macro-function, which Get Recent Comment makes use of. This function should generate the thumbnail of the user photo.
Or you could simply find a way to use php tags in the template for the recent comments.
Solution - 1The recent comments plugin suggests using the [[LINK href="http://islandgrl.net/wordpress/wordpress-profile-pic-plugin/"]]profile pic plugin [[/LINK]] and then using the %profile_picture macro to insert the author images. This is probably the easiest if you don't want to get your hands dirty in the code. You will not simply be able to use userphoto_comment_author_thumbnail() because that will echo the images directly to the HTML stream rather than append the string to the output variable that the recent comments plugin uses....... Thus your images will not end up where you want them to be. A quick and dirty hack if you want to continue to use the user photo plugin would be to edit the recent comments plugin code. On line 1380, change: to (note the double underscore instead of single) Then go back to your recent comments settings and add in the %profile_picture macro in the location you want the picture to end up. Solution - 2this code will display recent comment with the author's gravatar no plugin needed get_results("SELECT comment_date_gmt, comment_author, comment_ID, comment_post_ID, comment_author_email FROM $wpdb->comments WHERE comment_approved = '1' and comment_type != 'trackback' ORDER BY comment_date_gmt DESC LIMIT 10"); $comment_total = count($total_comments); echo '
";
echo get_avatar($total_comments[$comments]->comment_author_email,$size='32',$default=' ";
echo ' Solution - 3What I suggest you in order to get recent comments with gravatar is that, you should use this plugin. [[LINK href="http://wordpress.org/extend/plugins/recent-comments-plugin/"]]Recent Comments By Rob Marsh[[/LINK]] After downloading the plugin, activate it and jump to Recent Comments Option usder Settings tab. And then go to "Output" link under the heading. In the output code, place this code :
|
Wordpress |
Type: | Code Example |
Category: | Coding |
Sub Category: | Code Example |
Uploaded by: | Admin |
Views: | 7 |