Tuesday, June 22, 2010

教你在部落格添加回复楼层

Share




这个也是Blogger的失败之一~而痞客的也已经生锈了=P
如果大家注重视野上的完美~那么就来学学吧~

首先,到Design-->Edit HTML,将右上角的Expand Widget Templates打勾

然后按Ctrl+F找到</head>
在它的上面放上以下代码

<script type='text/javascript'>
//<![CDATA[
<!-- Function used for generating the index number for each post: ShowCommentIndex() -->
var CommentIndex = 0, CommentPostID = '';
function ShowCommentIndex(PostID) {
if (CommentPostID != PostID) {
CommentIndex = 0;
CommentPostID = PostID;
}
document.write(++CommentIndex);
}
//]]>
</script>




还没完哦~然后你就要找到类似下面这段代码

<dd class='comment-footer'>
<span class='comment-timestamp'>
<a expr:href='data:comment.url' title='comment permalink'>
<data:comment.timestamp/>
</a>
<b:include data='comment' name='commentDeleteIcon'/>
</span>
</dd>
</b:loop>
</dl>



找到了之后,将以下的代码放在</span>下面</dd>上面

<!-- Fixed for display comment index -->
| <data:commentLabel/> #
<script type='text/javascript'>
ShowCommentIndex('<data:post.id/>');
</script>



例子:
<dd class='comment-footer'>
<span class='comment-timestamp'>
<a expr:href='data:comment.url' title='comment permalink'>
<data:comment.timestamp/>
</a>
<b:include data='comment' name='commentDeleteIcon'/>
</span>
<!-- Fixed for display comment index -->
| <data:commentLabel/> #
<script type='text/javascript'>
ShowCommentIndex('<data:post.id/>');
</script>
</dd>
</b:loop>
</dl>

就是这样了~看得明白吗?@@

by:kenchy

1 comments:

himy said... 回复此评论

很喜欢你的教程噢~~
加油发布更多吧~!

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Post a Comment