Giacomo Barbieri
asked 5 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
DominicStaff
answered 5 years ago

Hi,
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 !

jaack
replied 5 years ago

Ok perfect thank you!

Powered by DW Question & Answer Pro