sangkrit

How to Separate Trackbacks / Pingbacks and True Comments


Organise the comment area by placing the comments on one side and trackbacks to other in your comments .php template:

<?php if ( $comments ) : ?>

<?php foreach ($comments as $comment) : ?>

<?php $comment_type = get_comment_type(); ?>

<?php if($comment_type == ‘comment’) { ?>

<!– This is a comment –>

<!– Comment’s content–>

<?php } else { $trackback = true; }?>

<?php endforeach; ?>

<?php if ($trackback == true) { ?>

<!– This is a trackback –>

<ol id=”trackbacks-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 } ?>

<?php else : ?>

<?php endif; ?>

 


3 comments to How to Separate Trackbacks / Pingbacks and True Comments

Leave a Reply