The Right Way Highlight Author Comments in WordPress


Sponsored Links






This Tricks original written by AEXT.net and we only share and to make it more clearly, especially for me. How To Highlight Author Comments in WordPress in the right way.

Highlight Author Comments in WordPress

Highlight Author Comments in WordPress

This code is better for the future and better for scalability such as, if you has more than one author in your WordPress site.

Write down Highlight Author Comments Code below

<li class="comment-container
    <?php
        $authID=get_the_author_meta('ID');
        if($authID == $comment->user_id)
            $oddcomment = 'authcomment';
        echo $oddcomment;
    ?>"  id="comment-<?php comment_ID(); ?>">
        ...

</li>

Please note, this code above only sample, you’ll need full code on your comment template to make it work, I’m only put on the first area on the WordPress Comment Loop and the closed tags. Then you’ll need to add CSS on your style.css

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

The Good news is, if you have new version WordPress Comment Loop, you only need added some CSS on your style.css

.bypostauthor {    background-color: #B3FFCC !important; }

And done, so if you are the author on current article and added some comment or reply, you comment will be styling differently. I hope this sample make it clear.

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

How To Highlight Searched text in Search Results

For Some reason we need to Highlight searched text in our WordPress Search Results. I know there are many plugin able to handle it. But on today WordPress tutorial, we will do it using function. No Plugin needed. To create … Read More

WP Tutorial: Remove admin name in comments class

Batovasan, create nicely WordPress Tutorial. The reason create this tutorial is Small Security Hole on WordPress. Like we all know by default, when the blog admin left a comment on his blog, WordPress use the name in the comment css … Read More

The simple way to show guest author name in your post

When your blog has many content writer, you might consider put their information into their own posts. You need to put some code in your index.php or else (like loop.php, home.php) as the main page and inside your single page. … Read More

Another Ways Remove all nofollow attributes from comments

I has written some tutorial How To Remove nofollow on Comments Text. Today tricks I will give another ways to do it, with more complex code and of course better code than before. The ways to do this is simple … Read More

How To Delete All WordPress Spam Comments Using phpMyAdmin

I have website that attacker more than 2000 spam each days. And I am so unhappy with it. I know I haven't installed any Comment Preventing system.  The WordPress spam comment attack is pretty smart because it is definitely automated … Read More

How To Create Fancy Highlight search-result

Use this tiny hack to Highlight search-result on WordPress. Open search.php and Replace the_exerpt() with: And then add the following just before the edited line: Now the last step is add .search-excerpt class your style.css and do whatever

Highlight Author Comments in WordPress, The Easier Right Way

I just came across a post published today which goes over the right way to highlight author comments in WordPress. Basically, instead of the usual code that read more

Source: http://www.themelab.com/2010/03/02/highlight-author-comments-in-wordpress/

How to Highlight Author Comments in WordPress | eHow.com

How to Highlight Author Comments in WordPress. When post authors reply not notice an author's comment right away, though. Highlighting author comments is an easy way to read more

Source: http://www.ehow.com/how_8220387_highlight-author-comments-wordpress.html

How to Highlight Author's Comments in WordPress

tutorial we will share one of the easiest and simplest way to highlight author's comments in WordPress. This method would fail for multi-author blogs right? read more

Source: http://www.wpbeginner.com/wp-tutorials/how-to-highlight-authors-comments-in-wordpress/

Highlight Author Comments in WordPress » Aonach Internet Strategy

In the comments of her post there is also a way to add an author image. 10 Responses to “Highlight Author Comments in WordPress” for leading me in the right read more

Source: http://aonach.com/chatter/highlight-author-comments-in-wordpress/

Highlight Author Comments in Thesis Wordpress Theme – Video

to highlight wordpress post author comments in this way you can differentiate author comments scroll right -0.4em ;} I trust it is enough for highlight author comments. read more

Source: http://fourblogger.com/how-to-highlight-author-comments-with-image-and-background-color-in-thesis-theme/


9 Responses to The Right Way Highlight Author Comments in WordPress

  1. Pingback: Tweets that mention How To Highlight Author Comments in WordPress # WordPress Tricks & Tips -- Topsy.com

  2. Pingback: uberVU - social comments

  3. Pingback: WP Tutorial: Remove admin name in comments class | Silver Blog

  4. Pingback: WP Tutorial: Remove admin name in comments class | Unlock IMEI Cellphones

  5. Mohsen says:

    Hi
    you saved me. thank you.

  6. TerapiUrin says:

    hmm.. when i change my template i need to include those codes again n again.. is there any comment highlighter that is compatible with wp 3.0?

  7. Pingback: wp-popular.com » Blog Archive » How To Highlight Author Comments in WordPress # WordPress Tricks & Tips

  8. SQL training says:

    I’m into learning word press now because our company trains us how to use word press. And it’s a good thing that I have crossed your website. Thank you for posting this!

  9. Geekyard says:

    Great hack :) Working fine… Now all my comments looks cool ;)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>