# 如何使用横幅主题功能针对特定群组？

**URL:** <https://meta.discourse.org/t/how-to-use-banner-topic-feature-for-specific-group/97768>\
**Category:** Feature\
**Created:** [2018 年9 月 21 日 13:59 UTC](https://meta.discourse.org/t/how-to-use-banner-topic-feature-for-specific-group/97768 "2018-09-21T13:59:28Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

作者： ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)\
发布日期： [2018 年10 月 4 日 09:36 UTC](https://meta.discourse.org/t/how-to-use-banner-topic-feature-for-specific-group/97768/17 "2018-10-04T09:36:21Z")

</div>

You will need to replace any of the CSS posted earlier with the following. This will hide the entire banner for anons and any users not part of a group that has an associated banner. Once again replace `GROUP_ONE`, `GROUP_TWO`, etc with the relevant group names.

```plaintext
body {
    // Hide the banner and all group-specific content by default
    #banner,
    #banner [data-theme-group] {
            display: none;
    }
    
    // Display the banner for the following groups only
    &.primary-group-GROUP_ONE {
        #banner,
        #banner [data-theme-group="GROUP_ONE"] {
            display: block;
        }
    }
    &.primary-group-GROUP_TWO {
        #banner,
        #banner [data-theme-group="GROUP_TWO"] {
            display: block;
        }
    }
    &.primary-group-GROUP_THREE {
        #banner,
        #banner [data-theme-group="GROUP_THREE"] {
            display: block;
        }
    }
}

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-use-banner-topic-feature-for-specific-group/97768)._
