Windy Community

    • Register
    • Login
    • Search
    • Unread
    • Categories
    • Groups
    • Go to windy.com

    Radar widget error message on a mobile page

    Bug Reports
    1
    2
    140
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sferics
      sferics last edited by

      Hello folks,

      I'm coding a wordpress page which is kind of a weather forecasting game (wetterturnier.de) and I want to integrate windy's radar widget in the sidebar. But if access the page on a mobile device (tried several browsers) the following error message is shown:

      photo_2019-11-26_23-13-29.jpg
      (screenshot from my dev server)

      At first, I just copied the iframe code into the sidebar, got this error and so I looked for a cleaner way. Then I created a widget in my wp-plugin with "register_widget()" from the wordpress API. But the message still shows up. Actually the widget should not even be called because on wordpress mobile pages there is no sidebar.

      Is there a way to prevent the iframe from loading by checking the user agent? Or could you make your code compatible to wordpress widgets?

      https://developer.wordpress.org/themes/functionality/widgets/

      Thanks in advance

      Juri

      1 Reply Last reply Reply Quote 0
      • sferics
        sferics last edited by sferics

        Ok I figured it out with the User Agent. My workaround looks somehow like this: https://www.codespeedy.com/simple-php-code-to-detect-mobile-device/

        I'm still wondering whether there is a more elegant solution to the problem.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
        NodeBB & contributors, OSM & contributors, HERE maps
        Terms of Use     Privacy Policy