Skip to content

Mstoic

  • Home
  • Start Here!
  • Best Deals
  • Facebook Tricks
  • Privacy
  • Resources
  • TOC
  • Tools
    • Web Tools
      • Stop Watch
      • QR Code Generator
      • Adsense Code Converter
      • Blogger Sitemap Generator
      • Difference Between Two Texts
      • Vacation Checklist
      • Twitter Symbols
      • Count Down
    • Investment
      • SIP Calculator
      • Power of Compounding
      • PPF Calculator
      • FD Calculator
  • About Us

Set Custom Gravatar Image As Default In WordPress

Editorial Team | July 4, 2014 | Webmasters, Wordpress |

If you use the default WordPress comments on your WordPress blog, then you would most probably be displaying the images of the commenters along with their comment. This image is displayed using a third-party service called Gravatar.

For people who do not have a Gravatar account, Gravatar displays a default image, which the site administrator can choose from the WordPress dashboard (Settings > Discussion). But there’s a limitation though. Gravatar does not allows you to set any custom image as the default image for WordPress comments, but we have a small snippet to help you with this.

Related Articles

  • Doing Complete SEO Of Your WordPress Website With WordPress SEO By Yoast
  • 15 Best SEO Tips for WordPress Blogs
  • Google Authenticator for WordPress
  • How to Edit .htaccess File from WordPress Dashboard Itself
  • Optimizing Database For WordPress Websites Automatically [Free Plugin]

Set Custom Image As Gravatar Default

Adding the below code to your functions.php will make the image gravatar.jpg stored in your active theme’s directory under the folder images as the default image for Gravatar.

function default_gravatar ($avatar_defaults) {     $myavatar = get_bloginfo('template_directory') . '/images/gravatar.jpg';     $avatar_defaults[$myavatar] = "Default Gravatar";     return $avatar_defaults; } add_filter( 'avatar_defaults', 'default_gravatar' );
Previous Post

Disable The Visual Editor In WordPress Dashboard

by Editorial Team

Next Post

No-follow All External Links In WordPress Without Plugin

by Editorial Team

Tags
  • Custom Gravatar Image
Recommended Next
Google Authenticator for WordPress

Your Comment Cancel reply

Follow Us

Like us Follow us Follow us

Categories

  • Tricks (93)
  • Facebook (83)
  • Tips (76)
  • Windows (67)
  • Wordpress (39)
  • Android (38)
  • Internet (33)
  • Antivirus (30)
  • How To (29)
  • Webmasters (25)
  • Customization (25)
  • Downloads (21)
  • Utilities (21)
  • Gmail (20)
  • Windows 7 (19)

Related Articles

  • Reverse a String using StringBuilder