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.
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.
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; ?>