See also this post:
We have some text included in the following html tags.
Some tekst or code
Is there a way to hide this part for users who do not belong to a certain group?
Any other suggestion on making this happen?
You can combine a few things to achieve this.
this theme component: CSS Classes for Current User's Groups
a little bit of custom CSS in your theme
this feature: Generic bbcode wrapper for theme components
So for example, if you have a group named
foo, the theme component (1) will add
.group-foo to the page for all members of the group.
Then add this custom CSS (2) to your theme:
Now you can use a generic bbcode wrapper (3) in a post’s content like this…
Only members of the group foo will see this content
So the CSS will hide the wrapped content for anyone that’s not a member of the
Note that this isn’t an entirely secure method to do this, savvy users could use their browser tools or safe mode to see this content if they knew what to look for.
If you need a secure method to hide content, you’d need to utilize a feature like whisper posts for staff (Create a Whisper post) or develop a custom plugin.