1. 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

Discussion in 'Styling and Customization Questions' started by WaddleJrJr, Jul 30, 2013.

  1. WaddleJrJr

    WaddleJrJr Member


    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 -

  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. WaddleJrJr

    WaddleJrJr Member

  4. AndyB

    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:

    @media (max-width:@maxResponsiveWideWidth) {
        .advertising_div {
            display: none;
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Hiding adverts using display:none may be against the ToS and could result in your account being suspended.
    thumped likes this.
  6. WaddleJrJr

    WaddleJrJr Member

    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.
  7. DFI

    DFI Active Member

    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 ?
  8. Brogan

    Brogan XenForo Moderator Staff Member


    They would have to manually select the style each time.
    DFI likes this.
  9. DFI

    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 ?
  10. Brogan

    Brogan XenForo Moderator Staff Member

    You would need a custom solution then, based on JavaScript.
  11. DFI

    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 ?
  12. DFI

    DFI Active Member

    Pls confirm this.
  13. Brogan

    Brogan XenForo Moderator Staff Member

    Check with Google if in doubt.

    I don't know what their ToS are.

Share This Page