# Sticky Footer Ad

**URL:** https://meta.discourse.org/t/sticky-footer-ad/186241
**Category:** Support
**Created:** [April 9, 2021, 5:16pm UTC](https://meta.discourse.org/t/sticky-footer-ad/186241 "2021-04-09T17:16:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![falcon9](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falcon9/32/311948_2.png) [@falcon9](https://meta.discourse.org/u/falcon9)
#### Post date: [April 9, 2021, 5:16pm UTC](https://meta.discourse.org/t/sticky-footer-ad/186241/1 "2021-04-09T17:16:06Z")

</div>

I am working with an ad company and trying to show their sticky footer code to only certain user groups. Is there any code that I can wrap the sticky footer in to make sure it only displays for the user groups that I want it to? It would need to display for all guests and all of my user groups except for one which is a paid membership.

---

<div class="post-metadata">

### Author: ![MrDavis97](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mrdavis97/32/206391_2.png) [@MrDavis97](https://meta.discourse.org/u/MrDavis97)
#### Post date: [April 10, 2021, 1:32am UTC](https://meta.discourse.org/t/sticky-footer-ad/186241/2 "2021-04-10T01:32:00Z")

</div>

First, make sure that the paid membership group is set to be the user’s primary group if they’re in that group (this can be done at `https://yoursite.com/g/{paid_group}`). Once that’s done, whenever a user is in that group, they’ll get a nice `primary-group-GROUP_NAME` class appended to the `<body>` tag. Now you can do something like

```plaintext
.primary-group-GROUP_NAME .sticky-footer {
    display: none;
}

```

so that the sticky footer will show up for everyone but those in the paid group.

This should be sufficient for your purposes. But note that there is also [this](https://github.com/discourse/discourse-groups-css-classes-in-body) theme component that adds all of the user’s groups as CSS classes to the `<body>`, which might help in more complex cases.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 10, 2021, 1:32am UTC](https://meta.discourse.org/t/sticky-footer-ad/186241/3 "2021-05-10T01:32:29Z")

</div>

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