iPad loads in BOTH mobile and tablet css with this plugin.
-
Hi!
I want separate CSS for tablet and mobile and desktop, let’s say
– mobile.css
– tablet.css
– desktop.cssIs there a reason why iPad loads BOTH the tablet.css and mobile.css?
While a mobile and desktop loads only the mobile.css or desktop.css – which is correct behaviour.I spent a month developing a separate CSS versions and as I am putting together the code, I am just finding out that either
– I am making a mistake in the PHP detection code
– or the plugin doesn’t actually recognise tablet properly, and iPad counts both as mobile and tablet device?This is the code I am using to decide what to load (7256 is the wordpress page ID). I put it into wordpress’ header.php
<?php if (is_page(7256) AND is_desktop()): ?> <LINK rel="stylesheet" type="text/css" href="https://mypage.com/wp-content/css/desktop.css"> <?php endif; ?> <?php if (is_page(7256) AND is_mobile()): ?> <LINK rel="stylesheet" type="text/css" href="https://mypage.com/wp-content/css/mobile.css"> <?php endif; ?> <?php if (is_page(7256) AND is_tablet()): ?> <LINK rel="stylesheet" type="text/css" href="https://mypage.com/wp-content/css/tablet.css"> <?php endif; ?>
Thank you for any quick help as I am approaching a strict deadline!
- The topic ‘iPad loads in BOTH mobile and tablet css with this plugin.’ is closed to new replies.