Looking to hide Likes & Decorate Op

Hi I have categories that are visible to public but only certain groups are allowed to post/reply.

I am looking for guidance thst if current user is not part of saud groups to hide the Like button in posts. To remove one of the many flaws of reddit.

I am also looking fir code to allow decorating a Topic Author so all of there posts in the topic identify them as Op.

Thanks.

1 Like

You can hide the like button with CSS, but that won’t prevent users from liking posts (a plugin would be required to ensure that), if they figure out how to un-hide the button for example.

I suppose the easiest way would be using CSS Classes for Current User's Groups which adds the current user groups to the body classes, then use CSS such as:

body.category-your-category-slug:not(.group-group_name) {
    button.like {
        display: none;
    }
}

Let me know if you have trouble understanding :slight_smile:

Here’s a related topic which, alas, didn’t have any reply. I cross-link so helping on one topic will help solving the other.

2 Likes

This will decorate responses by the OP to their own topic:

.topic-owner:not(:first-child) article .row .topic-body .topic-meta-data .names::after {
    content: "Topic Starter";
    color: var(--secondary);
    background: var(--secondary-medium);
    padding: 0px 8px;
    border-radius: 8px;
}

You could substitute “topic starter” for “OP” or whatever you like.

3 Likes

Cool this us working. I see it is every post adter First. Lol

How do I move this also to after name?

Or even space between decoration & name.

1 Like

I tried the code out of curiosity. By default, it’s set after your name:

But it depends on the HTML present in this section, which varies from a forum to another depending on the enabled features.

2 Likes

O have post badges plugin & National flags plugin, User Notes. Woupd anybof these interfer with position?

Alternatively can we sinoly add a border around the Op Name?

Here is a link to the post.