If you’ve observed your WordPress comments for each of your blog posts, sometimes you see comments, and others are trackbacks. Trackbacks are links back from another post, on another website. If another blogger mentions your post, and links to it, then you will see this. With some themes, you can disable showing this.
However, if you like to keep them, but keep them separate from the comments, here’s how to do it.
How to Display Comments and Trackbacks Separately
1. Find the comments.php file of your theme.
2. Open the comments.php file and find the following code:
foreach ($comments as $comment) : ?> // Comments are displayed here endforeach;
3. Replace it with the following code:
<ul class="commentlist"> <?php //Displays comments only foreach ($comments as $comment) : ?> <?php $comment_type = get_comment_type(); ?> <?php if($comment_type == 'comment') { ?> <li>//Comment code goes here</li> <?php } endforeach; </ul> <ul> <?php //Displays trackbacks only foreach ($comments as $comment) : ?> <?php $comment_type = get_comment_type(); ?> <?php if($comment_type != 'comment') { ?> <li><?php comment_author_link() ?></li> <?php } endforeach; </ul>
You can style these as needed.
Eva Smith says
Nice blog post about how we can show comments on our WordPress blog and trackback them. Nice blog post keep the good work going.