WordPress.org

Ready to get started?Download WordPress

Forums

PHP Browser Detection
[resolved] is_mobile() not working (5 posts)

  1. ykawato
    Member
    Posted 2 years ago #

    Hi, I am using is_mobile() and wasn't working so I did the following to make it work.

    Taking a look at the source code, line 238

    if(isset($browserInfo['ismobiledevice']) && $browserInfo['ismobiledevice']==1)

    changed it to

    if(isset($browserInfo['ismobiledevice']) && $browserInfo['ismobiledevice']=='true')

    and now it detects successfully.

    It's a very simple and great plugin. Thanks!

    http://wordpress.org/extend/plugins/php-browser-detection/

  2. ransom1337
    Member
    Posted 1 year ago #

    This fix doesn't work for me. Does anyone have any idea why, please?

  3. Yukon Cornelius
    Member
    Posted 1 year ago #

    That fix didn't work for me either. Actually, it broke things for ios user agent. @Ransom1337, did you manage to figure out a fix for detecting all mobile devices, or at least Android?

  4. ransom1337
    Member
    Posted 1 year ago #

    Indeed I did!

    I chose to use this plugin instead, it worked immediately:
    http://wordpress.org/extend/plugins/mobile-client-detection-plugin/

    Hope that helps.

  5. Yukon Cornelius
    Member
    Posted 1 year ago #

    Sweet. I'll give that a try. Cheers!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic