Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17215

    Hi,

    I have found a tutorial, how to highlight author’s comment. Unfortunately I can’t find any similar code parts in NEWSCAST’s files, where I can add this functionality as mentioned in this tutorial at point 9. Hightlight Author’s Comment »».

    I have looked at loop-comments.php and comments.php, but I can’t find any similar to change this.

    I have created my CSS for it:

    .autorkommentar { background-color: #a882bd !important; }

    The tutorials suggests to look in the comments.php for something similar like this:

    <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">

    to replace it with this:

    <li class="<?php if ($comment->user_id == 1) $oddcomment = "authorstyle"; echo $oddcomment; ?>">

    But I cannot find any code like the one I should search for. Can you please help me out? Thanks a lot.

    #94596

    Hi colorit2,

    That looks to be a bit outdated. You can use a bit of css to style specific author comments and no need to modify the php files. Try adding the following to your style.css:

    .commentlist .comment-author-yourid .comment_content {
    background-color: #a882bd;
    }

    Change yourid to your username and it should modify your comments.

    Regards,

    Devin

    #94597

    Hi,

    I have used this CSS

    .commentlist .comment-author-1 .comment_content {

    background-color: #a882bd;

    }

    ID 1 is my (author) ID, but it has no effect at all. Are you sure, that no PHP file needs to be edited for the class .comment-author-1?

    #94598

    Open up wp_list_comments.php and replace:

    <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">

    with:

    <?php
    $id = get_comment(get_comment_ID())->user_id;
    $author_id = ($id) ? ' comment-author-'.$id : '';
    ?>
    <li <?php comment_class(); echo $author_id; ?> id="li-comment-<?php comment_ID() ?>">

    and Devins code should work.

    #94599

    thanks, Peter, but this has also no effect. NEWSCAST seems to change the comment background rotatory. Uff, my English is not so good … in German:

    abwechselnd, egal, wer kommentiert, Autor oder User, wird der Hintergrund desjenigen Kommentars hellgrau, wenn der nächste Besucher kommentiert, wird der gleiche Kommentar des Autors weiß usw.

    You can see it live here in the demo:

    http://www.kriesi.at/themes/newscast/2010/03/06/why-doesnt-apple-rebrand-to-banana/

    The background colour of the comments is always changing there.

    #94600

    Can you just link us to the site with an admin’s post on it? Then I can give you the specific css for that admin as it is *not* the ID but instead its the username that appears as a class in the css for the post.

    Regards,

    Devin

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Highlight author's comments in NEWSCAST’ is closed to new replies.