assumes that your theme is using comment_class()
;
example (to be added to functions.php of your theme):
add_filter( 'comment_class', 'comment_class_logged_in_user' );
function comment_class_logged_in_user( $classes ) {
global $comment;
if ( $comment->user_id > 0 && is_user_logged_in() ) {
global $current_user; get_currentuserinfo();
$logged_in_user = $current_user->ID;
if( $comment->user_id == $logged_in_user ) $classes[] = 'comment-author-logged-in';
}
return $classes;
}
requires formatting of the css class:
.comment-author-logged-in { }
I recently posted a plugin version in my site.
Related Posts:
- Commenting in user profile page?
- Show content only if member left a comment
- Post comment as different user than logged in
- Get most active users sort by comment count
- WordPress comments email notification for authors
- List User Comments on User Profile BuddyPress [closed]
- Hold comments for moderation only if user is not logged in
- Display WordPress commenter nice name
- Check if someone recently commented in one of my posts
- Display the number of unseen comments on a page since the user last visit
- Allow the comment author to delete their own comments
- All users/comments suspected as bot? [closed]
- Commenting in user profile page?
- if user role is then echo text
- Remove the deleted user comment
- Anonymize comments after one year
- How can I get list of emails of users who commented on a post?
- Best way to tell if a comment is from a user?
- Custom comment field not showing when logged-in
- get_comment_author_link not working properly
- Problem in getting user comments permalinks
- wp list all users who haven’t commented on a post
- I want to limit registered user to 1 comment per post in WordPress
- Let user delete comment on front end only
- selectively disable akismet
- How to display comments by logged in user and responses?
- Deleting users do not deletes coments
- delete user not working
- comments reply script not working
- What should I do to make generated avatars different for anonymous comments?
- Check If comment author is registered
- How do I set up real anonymous posting in bbpress forums? [closed]
- How do I turn off wordpress comments ability to capture a users ip address?
- Success message in comment form
- How to remove commenters ability to add hyperlinks to comments?
- Is there a hook for comment author link?
- Exclude internal links from comment moderation?
- Change the HTML output of comments
- Plugin to require Twitter or Facebook login before posting a comment [closed]
- Upload images with comment
- Prevent Contributor to show comment list
- where to modify get_comment_author_link()?
- Change language of comments template
- Why Allow Script Commands in Comments?
- How to enable comments options?
- WordPress comment count to include attachment comments
- How to no follow the paginated comments
- Remove “Comments are closed” Notice from Custom Post Type template
- Comment count wrong with orphaned comments
- Pings and replies
- Retrieve comments from current post using SQL
- Comment_Reply_Link Not Showing?
- Display recent comments with gravatar and excerpts?
- Sync comment data
- Comment displaying full name even after setting another display name?
- How to move comments box above comments
- Ability to leave comments broken
- How to disable comment flood temporarily in a single scope
- How to create a seperate commenting system?
- Change how many approved comments must user have
- Only admin can see comments on post or page
- Count comment threads, not total comments in a post
- Display Custom comments field number
- Trying to post a wordpress comment on my site redirects to 127.0.0.1
- How can get comment link by comment id?
- How to amend time format of comments, using child-theme?
- Make user’s name display as the site name in comments if it matches certain roles
- Display avatar with comment form?
- Adding SQL source code to comments
- How to control size of comments popup window?
- Sent comments notifications to multiple users
- Applying same style to all the comments on the page
- Customise Comment form
- assumed as comment line
- Separate page for comments using permalinks and add_rewrite_rule
- Return count for characters in the comment and perform action based on the length
- How to load new posts from wordpress db into wordpress homepage without refreshing the site?
- comments.php remove date/time’s #hyperlink
- comment just attachment .. reply just text … can I do that?
- How to make email field not required in comments?
- edit comments in front end
- How to replace anonymous comment form with a registration form on wordpress?
- What is wrong with this? [closed]
- Comment moderation
- I have tried using Plugins to remove 72K comments with no success
- How to get the 5 most recent comments and each comment 5 most recent replies (children)
- Comment text area in single blog post and show comments if approved
- comment files and s
- How to ‘If Author’ Comments Check
- Disqus moderation page not working in WordPress admin section
- Comment forum to display under the comment you’re replying too
- Recent comments per tagged post?
- Subscribe to a post’s comments without posting a comment yourself
- Comment submission & navigation redirects to default language
- How to hide the login / profile urls on top of comment box for a post
- wp_list_comments adds unnecessary elements
- Why default comment fields don’t show up?
- comment awaiting moderation
- How do you fetch the authors email or IP from /comments? (REST API)
- How can I filter the user avatar displayed in comments? – get_avatar_url filter works everywhere but not in comments