Search the Community
Showing results for tags 'mobile detect'.
-
Hi there, I've been trying to figure out some PHP that will detect mobile, tablet and desktop. I'm so close... the problem is that the 'tablet' part of the code is also reading as a 'mobile' device. Is there a way to make the 'tablet' function ignore the 'mobile' function? P.S. I'm using the standard Mobile_detect.php Here's my code: [ <?php include_once "wa/includes/Mobile_Detect.php"; $detect = new My_Mobile_Detect(); ?> <!-- TABLET START --><?php if($detect->isTablet()) { ?> <div style="float:right;position:relative;margin:35px 25px 40px 0px;font-size:40px">(206) 601-1904</div> <!-- TABLET END --><?php } if($detect->isMobile()) { ?> <a href="tel:(206) 601-1904" style="float:left; position:right; position:relative;top:10px; left:100px; margin-bottom:-25px !important; text-decoration:none;" title="Call (206) 601-1904"><img src="http://www.legend-cars.com/wp-content/uploads/2012/11/phone_icon.png" width="90" height="90" alt="Call (206) 601-1904"></a> <a href="tel:(206) 601-1904" style="text-decoration:none;" title="Call (206) 601-1904"><span style="font-size:40px;float:left; margin:15px 25px 0px 115px;line-height:1em;">Call<br />Us!</span></a> <a href="sms:2066011904" style="float:left; position:right; position:relative;top:10px; margin-bottom:-25px !important; text-decoration:none;" title="Text (206) 601-1904"><img src="http://www.legend-cars.com/wp-content/uploads/2012/11/text_icon.png" width="90" height="90" alt="Phone Icon"></a> <a href="sms:2066011904" style="text-decoration:none;" title="Text (206) 601-1904"><span style="font-size:40px;float:left; margin:15px 0px 0px 20px;line-height:1em;">Text<br />Us!</span></a> <?php }else{ ?> <!-- DESKTOP START --> <div style="float:right;position:relative;margin:35px 25px 40px 0px;font-size:40px">(206) 601-1904</div> <!-- DESKTOP END --><?php } ?> ] Thanks in advance ecarollo