April 12, 2006
5:42 pm | Last updated: April 12, 2006 at: 5:53 pm
Here’s some code below to enable you to separate pingbacks/trackbacks from comments in Wordpress 2.0. Pingbacks/trackbacks are listed first, followed by comments in this example. It will also not show the excerpt for pingbacks/trackbacks and just show the link for these.
The basic idea is to loop through your comments twice - once displaying the pingbacks/trackbacks and once displaying the comments.
Copy and paste this code into your comments template - you’ll need to remove the old display of comments first.
[code]< ?php if ($comments) : ?>

< ?php if (get_comment_type() !="" "comment"){ ?>
< ?php /* changes every other comment to a different class */
if ('alt' ="=" $oddcomment) $oddcomment ="" '';
else $oddcomment ="" 'alt';
?>
< ?php } ?>
< ?php endforeach; /* end for each comment */ ?>
Comments
< ?php foreach ($comments as $comment) : ?>
< ?php if (get_comment_type() ="=" "comment"){ ?>
< ?php comment_text() ?>
< ?php /* changes every other comment to a different class */
if ('alt' ="=" $oddcomment) $oddcomment ="" '';
else $oddcomment ="" 'alt';
?>
< ?php } ?>
< ?php endforeach; /* end for each comment */ ?>[/code]
[Source: cre8d-design.com]