[Support request] AMP problems

Home Forums Support [Support request] AMP problems

Home Forums Support AMP problems

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1613549
    Sunil

    Hello

    I’ve installed AMP plugin and your support plugin from github. The problem I see now is that the menu has an unwanted top border that needs to be removed. Moreover, the menu doesn’t appear when the user scrolls up.

    How can we fix this?

    #1614098
    David
    Staff
    Customer Support

    Hi there,

    I am not seeing the menu border on my device, did you resolve that ?

    Sticky Navigation won’t work with AMP as it requires JS which AMP does not support.

    #1614184
    Sunil

    Hello David

    You checked the website when I switched off amp plugin to diagnose the issue. I’m not able to resolve it (example image – https://imgur.com/MEfkEhU .
    I can work without sticky menu but is there a way to show search in the menu? Other plugins like AMPforWp show search on AMP (along with sticky menu too).

    Is there a way you can add that? The search option?

    #1614744
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    That gap is being added by this Facebook code: https://www.screencast.com/t/91uEw4670

    You may want to make it so that code is only inserted when AMP is off, or add it to the footer.

    Our navigation search requires javascript, but you can always insert a regular search bar into the navigation on AMP using a Hook Element.

    #1618723
    Sunil

    Thanks Tom

    Can you provide me with the code for the hook element. And can you guide me how can I make it AMP specific. Couldn’t find display rule for the same.

    #1619264
    Elvin
    Staff
    Customer Support

    Hi there,

    To make amp specific conditions, you can use is_amp_endpoint().

    Example:

    <?php
    if (function_exists( 'is_amp_endpoint' ) && is_amp_endpoint()) {
        echo 'this is amp enabled'; // do stuff
    }
    ?>

    If you place this code inside a Hook element with hook set to generate_after_header, when the page is amp enabled, the text this is amp enabled will show under the header.

    Now that said, you can try looking for navigation plugins that are known to work well with AMP enabled sites that have shortcodes.

    You can then do something like this within a Hook Element:

    <?php
    if (function_exists( 'is_amp_endpoint' ) && is_amp_endpoint()) {
        echo do_shortcode( '[your navigation shortcode]' );
    }
    ?>

    A wise man once said:
    "Have you cleared your cache?"

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.