• Resolved asrme

    (@asrme)


    I want to show a message to visitors when they visit amp posts – You’re viewing amp version, switch to non-amp.
    How to do so?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @asrme

    Thank you for the support topic, are you using Transitional Mode or Reader Mode?

    If so the AMP plugin already adds a Link at the footer to view non-AMP version
    Exit mobile version

    You can also use the amp_is_request() function to determine between AMP and non-AMP version.

    eg:

    
    if ( function_exists( 'amp_is_request' ) && amp_is_request() ) {
    ?>
         <div class="popup">You are viewing AMP version click on <a href="<?php echo get_permalink(); ?>">this</a> link to view non-AMP version</div>
    <?php
    }
    

    Hope this helps!

    Thread Starter asrme

    (@asrme)

    Where to add this code? I want a popup to display message – you are viewing AMP version, switch to non-amp. I am using Transitional AMP.

    • This reply was modified 4 years, 9 months ago by asrme.
    Plugin Support Milind More

    (@milindmore22)

    Hello @asrme

    you can use that code in the theme’s functions.php or in theme files (header.php, footer.php) where you want to display that message.

    Also, you need to add CSS for that popup

    if you are non-dev I will recommend using AMP Enhancer Plugin, which has the custom popup functionality.

    Plugin Author Weston Ruter

    (@westonruter)

    We also have an issue open which would allow you to add a “Exit mobile version” link to the footer on AMP pages: https://github.com/ampproject/amp-wp/issues/5293

    We currently only show this link when you have mobile redirection enabled.

    Plugin Support Milind More

    (@milindmore22)

    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 5 replies - 1 through 5 (of 5 total)

The topic ‘amp message’ is closed to new replies.