I’m currently making a WordPress theme and all is going swimmingly.
It’s responsive, but I seem to be having a problem with the avatars in the comments section. What I want to be able to do is wrap the avatars in a separate div in order to specify a width and take advantage of img { max-width: 100%; } . Currently it has siblings in the DOM so this I cannot do it on it’s current parent. One would assume that I would need a custom function in functions.php and then use the callback parameter in wp_list_comments?
Current output:
<div class="comment-author vcard">
<img alt="" src="img_url" class="avatar avatar-74 photo">
<cite class="fn">James</cite>
<span class="says">says:</span>
</div>
Thanks.
The filter
get_avatar
will do. Note that this function is also pluggable, meaning that you can overwrite it with your own if needed.Here are the values received in each parameter: