让wordpress的评论显示楼层序号的方法
2008年10月7日
8 条评论
修改comment.php文件:
- 1. 找到<ol class="commentlist">,在这句下面添加<strong><?php $relax_comment_count=1; ?></strong>
- 2. 一般下面都会有一段<li></li>的语句,在这段语句下面添加<strong><?php $relax_comment_count++; ?></strong>
- 3. 上面说到的那句<li></li>中可以找到一句<?php comment_text() ?>,在此句上方添加<strong><div class="commentcount"><?php echo $relax_comment_count; ?></div></strong>
- 接下来就是用css来调整一下commentcount的表现形式,在style.css里增加类似下面的内容:
- .commentcount {
- font-family: Georgia,sans-serif;
- font-size: 24px;
- font-weight: bold;
- color: #e0e0d0;
- float: right;
- }
Weekly Most Commented