Category Archive for 'wordpress'

Separating Pingbacks and Trackbacks from Comments in WordPress

I quite like my current WordPress theme: Fresh from Wolfgang Bartelme.

But now that I am getting some trackbacks and pingbacks, I notice that the comment handling is missing something that I generally value in a blog. When listing comments, I prefer the real, human comments to be separated from the pingbacks/trackbacks. Although the pingbacks/trackbacks are completely important for their SEO value, I find that they can interrupt the flow of the conversation, disrupting the continuity. In my opinion, it’s better to list them separately.

Fortunately, it’s pretty easy to do. The theme file comments.php usually contains a loop that renders all the comments. The core of the technique is to use the WordPress function get_comment_type() to determine the type of comment, then build two distinct buffers, one for which get_comment_type() returns ‘comment’, another for all the others (the trackbacks and pingbacks).

More details – though using a slightly different overall approach – can be found at Ryan J. Parker’s blog which, ironically, uses a modified version of the Fresh theme and where I suspect that this very post itself will appear as a pingback, nicely separated from the real human comments. ;-)

Fresh theme validation

Just noticed that the newly deployed Fresh theme claims to validate XHTML 1.0 Strict, but fails on the Pages (as opposed to posts) as a result of declaring two elements – the post wrapper <div> and the <h2> for the title – with the same id.

The theme is approx a year old, so I’m kind of surprised that no one else has mentioned it. Wondering if that makes me particularly perceptive. Or particularly compulsive? Or, horrors, particularly wrong?

I have posted a comment for iLEMONed, the theme author. In meantime, I have hacked my local copy with an obvious tweak.

2009-08-20, Update: No response from iLEMONed. Oh well, mine is hacked. and validates.

Now to tackle the invalid CSS produced by one of the plugins.

Onward!