I\'ve been trying to use get_avatar to display the author\'s gravatar under each post in wordpress template with applied class but I couldn`t find a way to add
Another way to do this for future searchers, very simple string manipulation which is probably a bit safer if they change the function in the future e.g. it'll likely always have a 'class'.
$grvimg = get_avatar('email address', 200);
$grvimg = explode("class='", $grvimg);
$grvimg[1] = 'your-class ' . $grvimg[1];
$grvimg = $grvimg[0] . $grvimg[1];
echo $grvimg;