WordPress.org

Ready to get started?Download WordPress

Forums

P2 - Highlight author comments? (6 posts)

  1. erikbeam
    Member
    Posted 5 years ago #

    In P2, is there an easy way to highlight the original author's comments?

    I've found a few places where they tell me to change the comments.php file. Something like...

    <li class=”<?php echo $oddcomment; ?>” id=”comment...>

    But the P2 comments.php file has nothing like this...

    Is there anything I can do for this?

  2. ToreGu
    Member
    Posted 5 years ago #

    Do you have a link for the instructions you mention? It would be easier to follow then.

  3. erikbeam
    Member
    Posted 5 years ago #

    Here's one. The post is from 2008, but there are a couple comments that say it worked for them in version 2.8 (the same version I'm using).

    Thanks.

  4. ToreGu
    Member
    Posted 5 years ago #

    Hi again!

    I've tried to find the right code and this is the right one:

    function prologue_comment( $comment, $args, $depth ) { (below that function is the code showing comments)

    You'll find it in functions.php. I don't have the time to find the correct way to display author-comments in a different way. I tried with

    if( $comment->user_id == $post->post_author)
    {
    //special style
    }
    else
    {
    //default style
    }

    Which seems to be the simplest code to use for this.

    I hope you have more luck! I'm too new to PHP. :)

    Tore

  5. ToreGu
    Member
    Posted 5 years ago #

    Oh yeah. P2 is special so the code you started with isn't there. So that lead will not get you there. As far as I know..

  6. erikbeam
    Member
    Posted 5 years ago #

    I've tried several variations of what you posted, but I'm not much of a code guy. I can't seem to make a difference. Thanks for trying. I'll keep plugging away to see if I can get anything working.

Topic Closed

This topic has been closed to new replies.

About this Topic