如果你仅仅需要把当前日志的作者的留言和其他留言区分开开,只需要使用 WordPress 自动生成的 class .bypostauthor 即可。
所以当你的博客有多个作者的时候,如果需要把所有作者的留言样式和其他留言区分开,下面就是我们具体代码:
<li class="<?php if ($comment->comment_author_email == "authorname@domain.com") echo 'author'; else if ($comment->comment_author_email == "anotherauthorname@domain.com") echo 'author2'; else if ($comment->comment_author_email == "thirdauthorname@domain.com") echo 'author3'; else echo $oddcomment; ?> item" id="comment-<?php comment_ID() ?>">
抱歉,没有与本文相关的文章。
标签: WordPress


