XF 1.2 Excluding ads if viewed from mobile

WaddleJrJr

Member
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
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;
    }
}
 

Brogan

XenForo moderator
Staff member
Hiding adverts using display:none may be against the ToS and could result in your account being suspended.
 

WaddleJrJr

Member
Hiding adverts using display:none may be against the ToS and could result in your account being suspended.
I'll be sure to check that with my ad provider. Although that does seem like the best way as I am not using AdSense.

Thanks for the heads up.
 

DFI

Active member
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
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
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 ?
 
Top