• Resolved mllapan

    (@mllapan)


    Hi.

    Is there a function to add EXIT MOBILE so I can add it on top, the same way as it is on footer, top sticky and change the text?

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

    (@milindmore22)

    Hello @mllapan

    Please add following CSS code snippet in Appearance->Customize->Additional CSS

    
    #amp-mobile-version-switcher {
       top: 32px;
    }
    

    PS: you may need to adjust the top position based on your site and theme.

    Thread Starter mllapan

    (@mllapan)

    Nah.
    That CSS is valid for admin, and disaster for user.
    And if top: 0; is used, and body padding of a padding of an exit element, than it is not possible to style it with admin bar….too confusing.

    I asked for function to call switcher in template, so I can style it in header, one on bottom will just be display: none;

    • This reply was modified 2 years, 6 months ago by mllapan.
    • This reply was modified 2 years, 6 months ago by mllapan.
    • This reply was modified 2 years, 6 months ago by mllapan.
    Thread Starter mllapan

    (@mllapan)

    Solved.
    Anyone that needs this, here is the code:

    <?php if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) : ?>
    <style>
    #amp-mobile-version-switcher-mine>a {
        display: block;
        padding: 15px 0;
        font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;
        font-size: 16px;
        font-weight: 600;
        color: #eaeaea;
        text-align: center;
        text-decoration: none;
        background-color: #444;
        border: 0;
    }
    #amp-mobile-version-switcher {
        display: none;
    }
    </style>
    <div id="amp-mobile-version-switcher-mine">
    			<a class="" href="<?php printf( wp_get_canonical_url() ); ?>" rel="noamphtml">Open normal site</a>
    		</div>
    
    <?php else : ?>
         
    <?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add Exit AMP at top of page instead of footer and change text?’ is closed to new replies.