Forums

Seperate comments and trackbacks (5 posts)

  1. ChristopherO
    Member
    Posted 5 years ago #

    Hi

    I am using WordPress 2. Does anyone know of a decent plugin to do this?

    thanks

  2. maerk
    Member
    Posted 5 years ago #

    How do you mean? Display comments and trackbacks in separate places?

  3. Lester Chan
    Member
    Posted 5 years ago #

    I wrote a small plugin(+ some hack to wp files) that can do it, because I cant find a easier way. lol

  4. ChristopherO
    Member
    Posted 5 years ago #

    bump.

    surely this is possible?

  5. Otto
    Tech Ninja
    Posted 5 years ago #

    It's possible, but probably not as a plugin. This is mostly controlled by your theme.

    Most themes separate the comments display out into a comments.php file. This code has a loop to display the comments. It'll look sorta like this:
    if ($comments) :
    ...
    foreach ($comments as $comment) :
    ... stuff to display the comment ...
    endforeach;
    ...
    endif;

    You could modify this to separate real comments from trackbacks/pingbacks. You'd do something like this:

    if ($comments) :
    ...
    // display tracks/pings
    foreach ($comments as $comment) :
    if ($comment->comment_type == "trackback" || $comment->comment_type == "pingback") {
    ... stuff to display the trackback/pingback ...
    }
    endforeach;
    // display normal comments
    foreach ($comments as $comment) :
    if ($comment->comment_type != "trackback" && $comment->comment_type != "pingback") {
    ... stuff to display the comment ...
    }
    endforeach;
    ...
    endif;

    Basically you loop through the comments twice, displaying only the tracks/pings or only the comments.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags