Site logo

Archived topic

How to Highlight Contributor and Administrator Comment in Posts

24 replies · Started by Ravi Saive on December 27, 2022

Viewing posts 1–15 of 25

Hi Team,

I want to highlight the comments posted by the Contributor and Administrator account on the posts.

Find more info in the private section...

Hi Ravi,

The code for that should be something like this:

.bypostauthor { 
background-color: #e7f8fb;
}

It's not adding the bypostauthor to your author's comment. Can you create a test post with a different author, and test if the code works there?

Hi Fernando,

Yes, I can't find bypostauthor in the author's comment, how could we add it? what's the solution? I have several authors, it's a multi-blog author site.

I added the given code, but it's not working...

My requirement is:

When a WordPress admin replies the comment should be highlighted with an Admin badge...
Similarly, when a Post author replies comment should be highlighted with an Author badge...

Hi Ravi,

Have you tested this?:

Can you create a test post with a different author, and test if the code works there?

What happened? GeneratePress has no control over this class. It's a WordPress feature.

Can you also try #1 here and check if that code will work?: https://docs.generatepress.com/article/debugging-tips/

Hi Fernando,

I created another article with a different author, but the code is not working...

Can you disable all non-GP plugins and add a new comment with that author to test? If you have a staging site, it would be good to test there instead.

Hi Fernando,

I tested on the staging site as well, but no luck the code is not working at all, even after disabling all non-GP plugins...

Are you using a custom comments section template? For instance, how did you add the comment-reply-title - Got something to say? Join the discussion.?

Hi Fernando,

No I am not using any custom comments template, I just used the following code in child functions.php to set the title.

//change text to leave a reply on comment form
add_filter( 'generate_leave_comment','tu_custom_leave_comment' );
function tu_custom_leave_comment() {
    return 'Got Something to Say? Join the Discussion...';
}

Hi Fernando,

I can't give you admin login details, but you can access my machine via Anydesk.

Sorry, we don't have Anydesk. If you can share the login credentials to the staging site, that would be great.

Hi Fernando,

The staging is on my local machine, you can download and run Anydesk.

Can you share the credentials to the live site instead? We won't touch/edit anything. We'll just check some things.

Sorry, I can't give an admin login, better if you access my local staging via Anydesk...

This archived topic is closed to new replies.