• The problem is when a new article is created and published by the WP Admin user and then later assigned to the actual author via the Quick Edit –> Author tab – the bypostauthor tag is missing…

    Whereas, if an author login to the WP dashboard and created a post, and publishes itself, then the bypostauthor tag is added automatically…

    See the link – where you can see the comments of the?Author?and?Admin?highlighted with a badge…

    Now the question is, all my previous articles are created and published by the WP Admin account, and later assigned to the Author. Now how do I make the bypostauthor tag added to these previous published articles?

    • This topic was modified 2 years, 2 months ago by tecmint.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Now the question is, all my previous articles are created and published by the WP Admin account, and later assigned to the Author. Now how do I make the bypostauthor tag added to these previous published articles?

    I just tested this, and the characterization you gave in your post is not quite what happens… at least not in my test.

    When the post is assigned to a new author, the original author ceases to be the author of the post… so the original author’s comments will not have the bypostauthor?class anymore — because this user is no more the author of the post.

    However, the NEW author, if they made or make a comment on the post, now gets thebypostauthor?class. Of course, the new author needs to be logged in while making the comment for WordPress to recognize them as the post author.

    If the NEW author has not left any comment (or only left a comment as a guest), then there will be no bypostauthor?class — because this class is exclusively for the current author of the post, and the user needs to be logged in to be recognized as such.

    If you want to highlight the original author’s comment, you need to target their individual username instead. The class is named something like comment-author-jdoe where jdoe is the username.

    Thread Starter tecmint

    (@tecmint)

    @gappiah

    Can you please provide the CSS to highlight the original author’s comment using class comment-author-jdoe.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to Highlight Author and Administrator Comments in Posts’ is closed to new replies.