- This topic has 5 replies, 4 voices, and was last updated 1 year, 6 months ago by
Elvin.
-
AuthorPosts
-
January 10, 2021 at 1:00 pm #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?
January 11, 2021 at 3:19 am #1614098David
StaffCustomer SupportHi 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 11, 2021 at 5:17 am #1614184Sunil
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?
January 11, 2021 at 10:20 am #1614744Tom
Lead DeveloperLead DeveloperHi 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJanuary 14, 2021 at 8:24 am #1618723Sunil
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.
January 14, 2021 at 5:24 pm #1619264Elvin
StaffCustomer SupportHi 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 textthis 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?" -
AuthorPosts
- You must be logged in to reply to this topic.