Hide Custom Header Links from anon

Everything is still doable via css, but you have to create a line for each link which can take some time.

If we take the demo for this component :

https://theme-creator.discourse.org/theme/Johani/custom-header-links

I’ll try your 3 scenarios with the Tech example.

Ex #1 visible to logged in users

.anon .headerLink.tech {
    display: none;
}

Ex #2 visible to not logged in users

.headerLink.tech {
    display: none;
}
.anon .headerLink.tech {
    display: inline-block;
}

Ex #3 visible to all users : don’t add anything


Replace text with the key word of your menu.

I’ll take a last example to help you. The css class to use for the item menu Your Vote Counts! is .headerLink.your-vote-counts

9 Likes