• I’m having a slightly problem with my blog. If you have a quick look at this post:

    https://www.teamkilled.net/blog/46/new-sam-max-web-comic-makes-my-heart-warm/

    You will note that the first comment is a trackback. Now, at the moment that trackback quite literally looks like a comment, which I’m not particularly happy about. I don’t mind the trackbacks appearing in the comment area, but I *would* like to be able to change the colour of the author name for example, and possible tag it with “Trackback”.

    Basically, what I’m looking for is a way to theme the trackback entry slightly different to a comment entry. However, despite scouring my comments.php from top to bottom I cannot find this – it just seems to use the regular comment template.

    If you can’t seperate them, is there at least a way for me to change what’s put as the comment? As you can see right now, it’s a fairly ugly “[…] Trackback: blah blah blah”, while I’d much prefer to change that to something a little more concise and obvious.

    Regards,

    Ryan Williams

Viewing 2 replies - 1 through 2 (of 2 total)
  • It doesn’t appear your theme is making use of it (for css styling purposes), but alternate (every other) comments are assigned an “alt” class. Look through comments.php for a bit of code like this:

    <?php
    if ('alt' == $oddcomment) $oddcomment = '';
    else $oddcomment = 'alt';
    ?>

    This is from the default theme’s comments.php. I’m assuming it’ll be the same code and variable ($oddcomment) in yours. Now let’s make it useful:

    <?php
    if('trackback' == $comment->comment_type) $oddcomment = 'trackback';
    elseif('pingback' == $comment->comment_type) $oddcomment = 'pingback';
    else $oddcomment = '';
    ?>

    Add .trackback and .pingback classes to your css and provide whatever style you see fit.

    Thread Starter RyanWilliams

    (@ryanwilliams)

    Thanks a lot, Kafkaesqui. That did the trick beautifully. ;

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customizing trackback output in single posts’ is closed to new replies.