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

XF 1.4 How to size ads based on screen size

Discussion in 'Styling and Customization Questions' started by popowich, Apr 26, 2015.

  1. popowich

    popowich Active Member

    Is there a way to select ad code within the responsive style based on detected screen size?

    For example there is a placement that I would like to show a large rectangle if desktop and the appropriate mobile size for iphones.

    Basically some flavor of if/else based on screen width.
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. popowich

    popowich Active Member

    Thank you,

    BTW, I'm having a difficult time trying to google or site search for "XenForo {anything}", any suggestions?
  4. Dylan V

    Dylan V Well-Known Member


    You can use also this method based on the JavaScript.
  5. popowich

    popowich Active Member

    I think I'm running into extra complication for the placement I'm working on because I'm trying to show a responsive unit to mobile and a linkbar to desktop.
  6. popowich

    popowich Active Member

    That won't work for linkbars since they're not an option with the other ad units.

    I ended up fixing this with @media styling showing a responsive ad to mobile and my existing linkbar to desktop.

Share This Page