对匿名用户隐藏自定义标题链接

所有内容仍可通过 CSS 实现,但您需要为每个链接创建一行代码,这可能需要一些时间。

以该组件的演示为例:

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

我将用技术示例测试您的三种场景。

示例 #1 对已登录用户可见

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

示例 #2 对未登录用户可见

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

示例 #3 对所有用户可见:无需添加任何内容


请将文本替换为您菜单中的关键词。

我再举一个例子帮助您说明。菜单项 您的投票很重要! 要使用的 CSS 类是 .headerLink.your-vote-counts