检查我的评论者是否也是他发表评论的帖子的作者的最佳方法是什么?
我知道有一种css方式(.byauthor
), 但是PHP呢?如何比较帖子作者和评论作者?我试着使用is\\u author()、the\\u author()和comment\\u author(),但它看起来并不正确(如果有人使用与author相同的昵称怎么办?)。
以下是我目前的代码:
<?php if(get_the_author() == get_comment_author()) _e( \'Author\', \'theme\' ) ?>