How to detect if mobile or desktop?

Hello!
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:

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

<div class='left-menu'>
        <h1>title</h1>
        <a>">works</a>
        <?php if ($page->isMobile()): ?>
            <a>about</a>
        <?php endif ?>
</div>

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?

:pray:

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!