I was playing around with my comments section as I wanted to style trackbacks differently from “normal” comments, and while playing around, I decided to just bump them down. The problem with the trackbacks was that they were interfering with the comment discussion. And as I want to keep that discussion as lively as possible, moving the trackbacks out of it was the best step…
Moving them out is actually quite easy. You normally have one foreach block for the comments. Now you make one like this for the normal comments:
foreach ($comments as $comment) :
if ($comment->comment_type == 'comment') {
And add one below that for the trackbacks and pingbacks like this:
foreach ($comments as $comment) :
if ($comment->comment_type != 'comment') {
Because you now have two different loops, you can style them differently as well!



or instead of making 2 foreach’s … you could just do inside the first foreach:
if($comment->comment_type == ‘pingback’)
{
//pingback comment
}
else
{
//normal comment
}
Thanks for the useful information!
Don’t suppose you fancy writing a plug in or tutorial for this do you Joast? I’m having difficulty getting my head round it but also displying the correct counts for when there’s no comments but several pingback etc.