网站建设要用H5吗/宁德市中医院
大多数Wordpress主题(默认情况下)都将评论和引用/ pingbacks组合在一起,并显示在同一列表下。 但是,为什么要分开他们呢? 只是为了使事情看起来更有条理,以便您的博客评论者更清楚地看到什么是评论,什么不是。
做到这一点并不难,但是您需要使用独立的WordPress博客(而不是wordpress.com),并且可以访问change comments.php。 启动您最喜欢的编辑器,然后开始。
您将添加和编辑comments.php。 因此,在开始修改该文件之前,请先对其进行备份。
第1步
寻找:
<?php foreach ($comments as $comment) : ?>
粘贴后:
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>
第2步
寻找:
<?php endforeach; /* end for each comment */ ?>
粘贴之前:
<?php } else { $trackback = true; } /* End of is_comment statement */ ?>
第三步
寻找:
<?php else : // this is displayed if there are no comments so far ?>
粘贴之前:
<?php if ($trackback == true) { ?><h3>Trackbacks</h3><ol><?php foreach ($comments as $comment) : ?><?php $comment_type = get_comment_type(); ?><?php if($comment_type != 'comment') { ?><li><?php comment_author_link() ?></li><?php } ?><?php endforeach; ?></ol>
<?php } ?>
而已。 更新您的博客,您会发现引用引用已从评论中删除并显示在其下方。 如果要在评论前显示引用引用。 最简单的方法是在两者中都添加<div>并通过CSS控制样式。 玩得开心。
翻译自: https://www.hongkiat.com/blog/how-to-seperate-comments-and-trackbacks-wordpress-tips/