Forums

Mobile Pack doesn't work for iPad (7 posts)

  1. sttaylor
    Member
    Posted 10 months ago #

    I enabled the WordPress Mobile Pack and it works great on my iPhone, but doesn't switch for my iPad. Is that just the way it is or can it be set to recognize iPads?

  2. jffsmns
    Member
    Posted 10 months ago #

    I encountered the same problem and dug into the plugins files for a bit to try and solve it. After some sifting through the code I found the solution.

    In the plugin directory 'wordpress-mobile-pack' you'll find the directory 'plugins', in that directory there's a folder called 'wpmp_switcher' where all the sweet switching goodness is going on.

    In the file 'lite_detection.php' there are a few functions that look at the browser User Agent for keywords and uses that to decide whether a browser is a mobile agent or not.

    Under the second function 'lite_detection_ua_contains()' you'll find a list of device names like android, blackberry, ipod etc. I added the name 'ipad' in the same fashion and voila, it worked!

    One of the reasons I think this was broken is because Apple explicitely added 'ipad' to their user agent code instead of keeping it the same as the iPhone.

    Hope that helps, happy hacking!

  3. kreatemedia
    Member
    Posted 9 months ago #

    To the above poster, I experimented with the method you used but still cannot get my ipad to recognize my mobile theme. Any other suggestions?

  4. LowBeat
    Member
    Posted 4 months ago #

    @ jffsmns It works!!! Thanks m8

  5. mvanboordt
    Member
    Posted 4 months ago #

    Thnx It works.

    @kreatemedia
    After you added the 'ipad', in the list and uploaded it to your server clear your cache and history on your iPad.

    If that doesn't work, here is the complete code. replace it with yoour original code.

    Cheers M.

    [Code moderated as per the Forum Rules. Please use the pastebin]

  6. cdonner
    Member
    Posted 4 months ago #

    Wouldn't you want to see the desktop theme on the iPad? My problem is rather that on Android tablets I get the mobile theme.

  7. mvanboordt
    Member
    Posted 4 months ago #

    @cdonner

    Yes I do but I just wanted to see if it works.

Reply

You must log in to post.

About this Topic