• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Excluding ads if viewed from mobile

#1
Hello!

I recently upgraded to Xenforo 1.2, and with the dynamic styling I've noticed that ads stretch the pages when viewed from mobile devices. Is there anyway to remove ads from being shown, but only when the site is being viewed from mobile?

Here's a picture to show what I mean -


Thanks!
 

AndyB

Well-known member
#4
I prefer to only have one style, the Default Style. This is much simpler because users don't have to switch styles.

You can add this to your EXTRA.css template to hide content for mobile users, here's an example:

Code:
@media (max-width:@maxResponsiveWideWidth) {
    .advertising_div {
        display: none;
    }
}
 

DFI

Active member
#7
Hiding adverts using display:none may be against the ToS and could result in your account being suspended.
Does it violates Google Adsense T&C ?

If Yes and i create two separate styles as suggested by you, how will users switch between the two while browsing on desktop or Mobile version ?
 

DFI

Active member
#9
But in that case everyone will choose the ad-free style only both for Desktop and Mobile browsing. Isn't it or it can be restricted ?
 

DFI

Active member
#11
What if i use conditional statements to show just 1-2 ads and disable remaining on Mobile. Does that too violates Google Adsense T&C ?