Trying to make a custom comment section.
What's the correct PHP to use to create this?
<li>
<div class="avatar" style="background: url(http://gravatar.com)></div>
<div class="comment">This is a comment.</div>
</li>
Andrzej answers:
put this to your functions.php:
function my_get_avatar_filter($avatar_html) {
$exp1 = explode("src='", $avatar_html);
$exp2 = explode("'", $exp1[1]);
return $exp2[0];
}
and this in comments template:
<li>
<div class="avatar" style="background: url(<?php echo my_get_avatar_filter(get_avatar($comment)) ?>);"></div>
<div class="comment">This is a comment.</div>
</li>