Having problems with a theme not showing avatars even though you’ve enabled them in the admin panel?

The Screaming Viking1 had this problem. The theme was using an outdated global variable ($author_email) in the comment loop. Since it didn’t exist, the get_avatar() call couldn’t be bothered to return the proper image code. However, it’s immensely happy if you just pass it a reference to the comment object itself - so changing this:

echo get_avatar($author_email, $size=”40″, $default_avatar );

into this:

echo get_avatar($comment, $size=”40″, $default_avatar );

fixed the avatars in that particular theme. (Zinmag’s Remedy.)


  1. This site used to exist in 2009, but it’s not there anymore. ↩︎