Hi All,
I need to modify the default class for get_avatar template tag how is this possible ?
Based codex the default class for gravatar is:
<img alt='' src='http://gravatarurl_or_default'
class='avatar avatar-$size' height='$size' width='$size' />
I need to change it to:
class= author_gravatar alignright_icon
Is there any possibility doing this ?
Thanks,
Raff
Bump.. In case anyone has experience like this...
get_avatar() uses a filter 'get_avatar' at the end, which you could use to change your css classes;
http://codex.wordpress.org/Plugin_API/Filter_Reference
add_filter('get_avatar','change_avatar_css');
function change_avatar_css($class) {
$class = str_replace("class='avatar", "class='author_gravatar alignright_icon ", $class) ;
return $class;
}
Hi alchymyth,
I put this on function.php and its works as simple is that based on Twentyten Template.
I hope it will help the others.
Thanks a lot for your helps
Cheers,
Raff
Ben Cao
Member
Posted 10 months ago #
I used this function,It works! Think you