If you have many useful and quality contents in your WordPress blog, you will likely get many trackbacks from other bloggers, those trackbacks usually appear inside the comment area and as the result they will be mixed with comments of your readers, this is sometimes disrupting the conversation among your visitors and looks not too neat.
And by default not all WordPress themes are designed with trackback and comment separated, thus we get to make them separated. And follow these steps to do so.
Steps How To Separate Comments And TrackBacks:
Head to your comment.php and find this code:
<?php foreach ($comments as $comment) : ?>
Right after the above code, put the following code, now:
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>
And then find this code:
<?php endforeach; /* end for each comment */ ?>
Just before the above code put this code:
<?php } else { $trackback = true; } /* End of is_comment statement */ ?>
What you’ve done above is to tell WordPress not to display trackbacks inside the comment area. But since we still need to display trackbacks too, then follow these steps to put trackbacks in separated area from your comment area to make your comment area is free from any trackbacks nor pinbacks.
Find this one:
<?php else : // this is displayed if there are no comments so far ?>
Before the above code put this one:
<?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 } ?>
Done! This hack only works if you set your trackbacks enabled or else just ignore this hack, and hope you’ll find this hack useful and see you in then next post of Premium WordPress Blog.
Related posts:





No Comments Yet - be the First!