Implementing Tweetbacks in WordPress up to 2.6
The TweetBacks WordPress plugin imports tweets as comments, storing them in between your other comments in the database. When it does that though, it gives them a specific type "tweetback". Because of this, you can separate the tweetbacks from normal comments and pingbacks/trackbacks.
To do this on WordPress 2.3, 2.5 and 2.6, follow the following tutorial:
- Go to your template directory, and open up your comments.php file.
- Locate this code:
<?php foreach ($comments as $comment) : ?>
immediately after it, add this:
<?php $comment_type = get_comment_type(); if($comment_type == 'comment') { ?>
- Next, scroll down a bit and find the following piece of code:
<?php endforeach; /* end for each comment */ ?>
Right before that, add the following:
<?php } else { $comments_by_type[$comment_type][] = $comment; } ?>
- Right below this you should find something like the following:
<?php else : // this is displayed if there are no comments so far ?>
Right before that, you should add:
<?php foreach ($comments_by_type as $comment_type) { echo "<ul>"; foreach ($comment_type as $comment) { ?> <li><?php comment_author_link() ?>: <?php comment_text() ?></li> <?php } echo "</ul>"; }?>
- That's it!





