Sticky Footer Ad

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.

2 Likes

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

.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 theme component that adds all of the user’s groups as CSS classes to the <body>, which might help in more complex cases.

2 Likes

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