If you use the comment_class
function to add classes to each comment, comments by the post’s author can be styled via the bypostauthor
class.
You can alternately match the comment ID against the post ID:
global $post;
if( $comment->user_id === $post->post_author ) {
// is author comment
}
Related Posts:
- Comments counter only for Authors Posts
- Change Comment Author Display Name
- How to add internal, revision comments to page updates
- Check If comment author is registered
- What’s the easiest way to close comments on media/attachments?
- Comment Author Name In Reply Form
- Display all comments or recent comments per user on author page
- how to make author to write comment on only his own posts?
- How to check if commenter is the_author?
- Let user edit his own comment
- Send Notifications to All Admins
- edit comments capability for authors
- Report spam button
- Why are authors allowed to approve comments on their posts? How to revoke privilege?
- Hide notifications regarding new comments
- List user comments in author page
- Author can only see own post comment and can moderate
- WordPress comments on users profile
- Comment displaying full name even after setting another display name?
- Filter In Reply comments from WordPress Admin Panel
- Same email for all comments
- Notify post author for a new comment on his post?
- warnCommentChanges always being triggered on update
- How many members have made comments approved for an article?
- Commentlist: bypostauthor problem with children list
- How do I disable the discussion notification emails to us when a comment is “approved” and when an adiministrator replies?
- Only Allow post author and “Premium” Role user to comment
- Admin Dashboard – Recent Comments source
- get_comment_author_link not working properly
- Get Comment Author ID on the fly while posting
- Styling Admin comments in WP 3.1.3
- Prevent users to delete comments from trash
- How can I hide comment of the authors from their published posts?
- WordPress Custom Local Avatar not showing in comments
- How do I add custom field to Admin comment form and display
- Attaching author tag to the comment
- How to prevent users/authors from seing IP/email of new commentators?
- Author name length character limit?
- where can I find the missing comments in my wordpress dashboard?
- Comments pagination on author page
- Change author, disable comments, enable trackbacks for all items in library
- Prevent author from editing comments from others in their post
- How to enable reply button on mostly deeply-nested comments? [closed]
- URLs to user page is broken
- Auto approve all comments (editor)
- Identify and display the fact that user is admin next to username in comment section
- edit-comments.php in Admin – how to change ‘Comments’ title?
- Query comments with non-empty ‘author_url’ value on Admin Comments Screen
- How to rearrange fields in comment_form()
- Commenting in user profile page?
- How do I delete all comments from a specific old blog post?
- Removing the “Website” Field from Comments and Replies?
- How to load and show comments with AJAX instead of pagination?
- Hook/Filter before and after comments
- Comment form validation
- I have tried using Plugins to remove 72K comments with no success
- show un-approved comments at wordpress front end
- How to add pagination to comments?
- How to get replies of a comment?
- show if comment is in moderation
- Deleting the attached “comment replies” when trashing a comment
- How can I get a list of comments by target
- Load comments.php template outside the post loop
- Auto-fill Custom comment fields
- How to auto empty comment trash after X days
- Control panel loads slowly due to 2 slow queries on comment table
- Display complete comment section via post ID
- Comment Pagination Behavior wp_list_comments() – comment ordering and pagination
- After Submitting Comment Form Shows an Empy Page in WordPress
- Unique User for all visitor, but possibility to comment with unique name
- comments_array filter doesn’t work in some themes
- Redirect when click on “response” in comment section
- Link to a User’s Forum Profile From Their Comment
- if user role is then echo text
- strange behavior with comment position
- Safely editing core files
- Way to count the number of people who have commented on a post?
- Batch approve comments
- Disable comments and pingbacks on old custom post types
- How to allow duplicate comments?
- WordPress comments – delimiter “/” not found
- Give subscribers the option to post anonymously
- Displaying comment counts in WP Gallery thumbnail view
- Removing comment option
- Edit Comments Fields
- Random output of comments using a shortcode
- Allow comments only for custom post type
- Comment author profile image
- Showing different images depending on user role
- Why the capability ‘activate_plugins’ is needed to allow a role to see all posts/pages/comments?
- How to require users not to be logged in for comments on single page only?
- How to change comment-page-1#comment-25 to any string?
- change text written in english into hindi
- comment-reply.js always focuses on comment textarea
- I need to delete all posts from my homepage & create a static front page [closed]
- Is there a better way to check for a new comment?
- delete user not working
- How to remove or customize “Comment” in comments form?
- check if a comment was made by a registered user
- Customize the new comment notifications sent to the post author after the comment is approved