在Blogger的回應加上使用者頭像

想要在blogger裡面每個回應都加上圖像可以這麼做。

1. 找到這段:
<dl id='comments-block'>
改成這樣
<dl expr:class='data:post.avatarIndentClass' id='comments-block'>

2. 找到這段:
<a expr:name='data:comment.anchorName'/>
在上面加上這段
<b:if cond='data:comment.favicon'>
<img expr:src='data:comment.favicon' height='35px' style='margin-bottom:-2px;' width='35px'/>
</b:if>
<a expr:name='data:comment.anchorName'/>
<b:if cond='data:blog.enabledCommentProfileImages'>
<data:comment.authorAvatarImage/>
</b:if>

因為圖像是抓google帳號的圖示,所以如果留言的人沒有google帳號,或他不是用google帳號留言的話,可以改css設定預設圖像。
/* Avatar */
.avatar-image-container img {
background:url('圖片網址');
}

加完回應就可以看到圖像了。

留言