Home / author / Highlight author comments
  • How to Highlight author comments

    no thumbnail sorry: Highlight author comments

    Adding this PHP code to your comments.php will add the class authcomment. The bellow CSS will let you change the background color of the author comment.

    ( click code to copy )

    wordpress snippet : PHP - comments.php

    <>
    <li class=”<?php
    /* Only use the authcomment class from style.css if the user_id is 1 (admin) */
    if (1 == $comment->user_id)
    $oddcomment = “authcomment”;
    echo $oddcomment;
    ?>”
    
    ( click code to copy )

    wordpress snippet : CSS

    <>
    .authcomment {
          background-color: #B3FFCC !important;
    }
    

    ( WordPress codex functions, hooks, in this snippet. )