比如还没人留言就显示“Add comments”,只有一条留言显示“1 comment” ,多条留言显示“n comments”;然后在CSS中定义.post-comment就可以了(当然你也可以改成其它的

),很多wp模板的作法。
代码:
复制内容到剪贴板
代码:
<span class="post-comment"><a id="p_comments<#article/id#>" href="<#article/url#>#comments"><#article/commnums#> comments</a><script type="text/javascript">if(<#article/commnums#>==0){document.getElementById("p_comments<#article/id#>").innerHTML="Add comments"};if(<#article/commnums#>==1){document.getElementById("p_comments<#article/id#>").innerHTML="1 comment"}</script></span> 中文显示可以改成:
复制内容到剪贴板
代码:
<span class="post-comment"><a id="p_comments<#article/id#>" href="<#article/url#>#comments"><#article/commnums#> 条评论了</a><script type="text/javascript">if(<#article/commnums#>==0){document.getElementById("p_comments<#article/id#>").innerHTML="发表评论"}</script></span>[
本帖最后由 月上之木 于 2007-1-20 14:27 编辑 ]