A spelled out how-to of hiding stuff from non-logged in users

I need to hide something in the global notice banner from those who aren’t logged in, in our private forum. At the moment, anything I put there is visible on the login page, which is unacceptable.

I’ve found the necessary CSS here, but I’m a bit inexperienced with plugging that into Discourse:

This what I tried, but it didn’t work:
Put this in the Theme common CSS:

html.anon div#logged_in_content {
  display: none;
}

I then put this into the global notice setting:

<logged_in_content>Test</logged_in_content>

What am I doing wrong?

1 Like

The notice needs to be inside the div you are styling with css, so like this:

<div id="logged_in_content">Some text here</div>

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.