• Resolved joycegrace

    (@joycegrace)


    Hello, is it possible to get this plugin to only apply its changes and effects on mobile devices? Such as by using is_mobile() or defining a screen width when it will go into effect?

    I’m in transitional mode, trying to use an AMP-compatible menu on AMP Urls only.

    Problem is, when I suppress that plugin for AMP, it disables it on the ‘big screen’ view which is not ideal for us. We use Max Mega Menu to display a long list of pages on wide screens (it would be awful to have one-column menus in this context). They don’t seem to have plans to make their plugin AMP compatible. I asked about this, here.

    So I’m attempting to ‘turn on’ the native Genesis menu, which is AMP-compatible, but only when the screen gets small enough for that to make sense.

    However, I feel like this would be useful in other contexts, too, to simplify things a lot without having to go ‘bare bones’ with Reader Mode. E.g. I can imagine using this method to take out non-AMP Gravity forms but only on smaller screen sizes, etc.

    I’m not a heavy coder but I can manage code snippets and things like that. Any help you can offer would be so greatly appreciated. Thank you for making this plugin for everyone to use.

Viewing 2 replies - 1 through 2 (of 2 total)
  • James Osborne

    (@jamesosborne)

    Thanks for reaching out. While it is possible to create a redirection for desktop only it’s not something we recommend or provide assistance with.

    Note that it’s unlikely you’ll encounter many visitors to AMP on desktop when using transitional or reader mode, with Search Engines serving the AMP version for mobile users.

    Rather than apply a desktop redirection if you’re looking to apply the Genesis menu for AMP URLs only you could use a conditional statement using is_amp_endpoint().

    Below is an sample snippet:

    <?php if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) : ?>
        <!-- Genesis menu code below -->
    <?php else : ?>
        <!-- Regular menu code below -->
    <?php endif; ?>
    James Osborne

    (@jamesosborne)

    As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Only load on mobile devices?’ is closed to new replies.