Recent Comments how to change the default gravatar
-
Hi I am using the following script to display my most recent comments it also displays the gravatar as well.
global $wpdb; $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,50) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 5"; $comments = $wpdb->get_results($sql); $output = $pre_HTML; foreach ($comments as $comment) { // Determine which gravatar to use for the user $email = $comment->comment_author_email; $grav_url = "https://www.gravatar.com/avatar.php?gravatar_id=".md5($email). "&size=35"; ?>
But it displays the default gravatar avatar I want to use my own default avatar how do I change it?
Hope you can help
thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Recent Comments how to change the default gravatar’ is closed to new replies.