I’m trying to define variables based on which OS the user is using. I’d like to define the name and links to each app version, defined in functions.php. Eg
if (MobileDTS::is('ios')) {
$appname = "iPhone app";
$applink = "https://itunes.apple.com/applink";
} else if (MobileDTS::is('android')) {
$appname = "Android app";
$applink = "https://market.android.com/androidlink";
}
Once I have defined the variables, I’d like to print them in my template file eg.
<a href="<?php global $applink; echo $applink; ?>">Download the <?php global $appname; echo $appname; ?></a>
Is this possible?
]]>Using the simple:
if (MobileDTS::is('android')) {
echo 'android';
} else if (MobileDTS::is('ios')) {
echo 'ios';
} else if (MobileDTS::is('mobile')) {
echo 'mobile';
} else {
echo 'No';
}
I get No on my iPad 1 using Chrome, works in Safari… any fix for this?
]]>Hi,
I use 2012 as mobile theme, I selected a top menu, when i switch back to original theme and go to the site on ,mobile – i see 2012 but with default , all pages menu
I tried using 2012 as primary theme, in this case it remembers the selected menu on mobile and show it
Thanks
Guy
https://www.ads-software.com/extend/plugins/mobile-detector/
]]>Hi,
Just wondering if there are any updates planned for this plugin? Would be great to have the options to exclude certain devices or even configure independently which theme they get send to.
Thanks,
Chris.
https://www.ads-software.com/extend/plugins/mobile-detector/
]]>Hello Everyone,
I have implemented a wordpress theme for desktop and also made it compatible to ipad by using media queries..So, at present same theme is working fine for desktop and ipad as well.
Now I want to implement a separate theme only for mobile, but this plugin takes ipad as a mobile device and open the theme which i select for mobile in ipad also.
As mentioned on the home page of the plugin –
Popular mobile devices
iphone (Apple iPhone)
ipad (Apple iPad)
kindle (Amazon Kindle)
I want to remove ipad from this list. So, Please suggest me a solution for it..ASAP
Thanks in advance..!!
Sunil
https://www.ads-software.com/extend/plugins/mobile-detector/
]]>I have an issue where images within the content are disappearing when the site hits the mobile theme … but not all images. I’m not sure if this has anything to do with the plugin.
When i view the full site, the images appear just fine, but then when i click the mobile site link, they disappear … AND … only on mobile devices – desktop browsers (viewing mobile theme) show fine.
I’m at a loss. Thanks.
https://www.ads-software.com/extend/plugins/mobile-detector/
]]>I’m experiencing some strange behaviour when using Mobile Detector. I’ve made my own mobile theme and both, desktop and mobile themes, have buttons to switch to each other. If a user for example goes to contact page and switches from mobile to desktop, the contact page is correctly shown as desktop. The next page will still be shown as mobile page however, but every time the user returns to the contact page, the desktop version is shown. So it seems that the theme settings is somehow page specific instead of site specific. This leads to some very confusing results where the theme is switched seemingly arbitrarily between page loads.
I have my own detection script for URLs starting with “m.”, but I don’t see how this could be messing with the detection:
if( preg_match( '/^m\.(.*)$/im', $_SERVER['HTTP_HOST'] ) && class_exists( 'MobileDTS' ) && !MobileDTS::is_mobile_theme() && !isset($_COOKIE['wp_mobiledts_theme']) ) {
wp_redirect(MobileDTS::get_switch_theme_link('mobile'));
die();
}
https://www.ads-software.com/extend/plugins/mobile-detector/
]]>I am finding that the language people use when speaking/writing about mobile site versions has a lot of confusion, which is in turn confusing me! I am considering your plugin but would like to be clear.
When I read about mobile themes it sometimes turns out they are a plugin, sometimes an actual theme. In your description and notes you discuss the code that determines which theme is served for a mobile device. When you say “theme” is this an actual theme placed in either a subdomain, sub-directory or separate url, or are you referring to a plugin?
If you are referring to actual themes, have you found it makes a difference if they are either subdomains or sub-directories?
Thank you!
https://www.ads-software.com/extend/plugins/mobile-detector/
]]>Hi there,
I love the plugin, been really helpful! One thing is that i’m trying to exclude the ipad so that it only uses the desktop theme on ipad (but switches to mobile on all other devices) – I’ve tried removing the ipad references from the ‘mobile-detector.php’ file but it still directs to the mobile theme when I visit through an ipad (even after clearing all cookies).
Would really appreciate any help you can offer.
Thanks in advance and kind regards,
Andy
https://www.ads-software.com/extend/plugins/mobile-detector/
]]>Works with W3C Total Cache?
https://www.ads-software.com/extend/plugins/mobile-detector/
]]>HI ,
Your plugin works great! I was wondering if once there is a code I can add to the php that sends the client to the desktop url once they have already been to the mobile site. In this fashion, they could choose to go to the desktop url even though there is a redirect to mobile for it.
Thanks in advance
https://www.ads-software.com/extend/plugins/mobile-detector/
]]>how do I use this plugin to direct to a specific .css?
thanks
https://www.ads-software.com/extend/plugins/mobile-detector/
]]>