WordPress theming: pushing trackbacks down
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!



by Andrei Serdeliuc on 5 July, 2007 at 23:12
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
}
Pingback: links for 2007-07-05
by JWB on 10 July, 2007 at 17:10
Thanks for the useful information!
by Diesel on 15 March, 2008 at 17:22
by paul on 3 November, 2008 at 17:49
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.