-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using ?amp=1 while using pretty permalink or hooks to use custom amp url #353
Comments
You can use the |
Thanks a ton @mjangda for pointing this out. |
Just using that filter should do it since we use the function internally to get the AMP URL for each post. If not, it might be a bug. I guess we could provide another filter in this function that runs before we generate the AMP URL ( |
Actually in my case my site has a m.site, for serving mobile traffic automatically, and that filter is done from server. And as our link structure is like domain.com/category/post-title/, so with amp it becomes domain.com/category/post-title/amp/ which I find that very hard to filter from nginx.conf and stop the redirection for mobile device. But if I could use argument like ?amp=1 its easier for me to filter and stop redirection. And yes this 'amp_get_permalink' happens on the top, and adding filter to modify it does not work on header. I think the plugin should have a option page, very simple one, and we should be able to change amp url as we want, and you could use that on 'amp_pre_get_permalink'. |
For one of my project I need to use url with argument, so ?amp=1 is fine while the project use pretty permalink.
Is there a hook to change amp url? I could edit source in amp.php but need a hook so could remain valid after plugin update. And here canonical url needs to update as well, so hook is best. I could not find a hook so far, please direct me if we already have one, or let'r make it a feature addition, and bring it on.
The text was updated successfully, but these errors were encountered: