How to detect if mobile or desktop?

I try to find a way to use mobile detect.
many posts recommend this plugin but it seems that it is no longer available?

What is best way to detect if mobile or desktop?

thanks a lot!

Thanks - I can’t make it work. Im probably doing something wrong.
this is a page template:

// These lines are mandatory.
require_once 'Mobile_Detect.php';
$detect = new Mobile_Detect; 

<div class='left-menu'>
        <?php if ($page->isMobile()): ?>
        <?php endif ?>

But I keep get the error: “require_once(Mobile_Detect.php): Failed to open stream: No such file or directory”

I looked for the file “Mobile_detect.php” in the plugin files and there is a file in the classes folder called “MobileDetect.php”. so I changed the file name in the top to “MobileDetect.php” as well but still not working.

any idea?


Please see the documentation how to use it.

You don’t require anything

I try - can you please point me to the documentation?
I looked here but couldn’t understand what am I doing wrong

It seems like it doesn’t find the plugin file.

See the link above, not the underlying dependency.

Ok - manged to solve it somehow
Thanks a lot for the help!