Giacomo Barbieri
asked 9 years ago

Hi, I was wondering if DW Argo theme supports mobile detect (through a PHP function) and how I can use it

1 Answers
answered 9 years ago

You can add the following code to the functions.php file:
include("includes/Mobile_Detect.php"); global $detect; $detect = new Mobile_Detect;
Then add the following code to the header.php file:
if ($detect->isMobile() || $detect->isTablet()) { echo '<h1>MOBILE</h1>'; } else { echo '<h1>DESKTOP</h1>'; }

Hope this helps !

replied 9 years ago

Ok perfect thank you!

Powered by DW Question & Answer Pro