Hi I am Isa Nagib, one of the contributors of this blog. I like writing and reading all the about technology stuff, thus this blog is media for me to write down about technology!
Be my Twitter, Facebook, +Isa Nagib Google friends, together we can be good friends
Abi
How to Separate Comments From Trackbacks
Some WordPress themes are designed to have separated trackbacks from comments, but some themes are not. There are bloggers that don’t get a long with the idea of mixing trackbacks and comments on the single comment page, because it doesn’t look neat and I am one of them. If you’re one of us and your own WordPress theme doesn’t support your wish, you can follow this simple tips to separate comments and trackbacks.
1. Search the following code:
<?php foreach ($comments as $comment) : ?>
Put this right after it:
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>
2. And now search the following code:
<?php endforeach; /* end for each comment */ ?>
Put this before the above code:
<?php } else { $trackback = true; } /* End of is_comment statement */ ?>
3. Find this
<?php else : // this is displayed if there are no comments so far ?>
Paste before it:
<?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 } ?>
Save or Update File!
Now you’ve separated trackback from comments and the look of your comment page will be neat. And one more thing, there are several WordPress theme don’t have
<?php foreach ($comments as $comment) : ?> like mine, thus I can’t apply these steps but I am currently searching for solution.
Hope you find this post useful and see you again in SEO Blog.