I have found how to highlight comments made by author of the post. However, could not achieve to attach simple text saying this is author for each comment replied by the author of the post.
1 Answer
you can compare user_id to the author id, an then add your text.
global $post;
if ( $comment->user_id === $post->post_author ) { echo 'Author'; }
-
-
-
Inside of theme/library/functions/comments.php file where the actual comments are being pulled from. Mar 5, 2019 at 18:25
-
i added global $post; to my answear, check and tell me if it change something. ps : also, check the output html to see if present or not ;)– GregoryMar 5, 2019 at 21:04
-