hares-recovery

Posts Tagged ‘code’

Because it’s worth noting

General | Posted by Derek
Oct 17 2009

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

The Screaming Viking 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.)