Hi Dave
we have it done here so you can modify your content for AMP pages accordingly
Also let me know if this solves your issue and if you have any other queries feel free to reach us out 🙂
Regards
AzMak
Hey Dave ( @obilix99),
Thank you for asking the question, I apologize as I missed your previous ticket.
Yes, there is a function called is_amp_endpoint(), to check and the content will only load if the is_amp_endpoint() function is available.
You can use this function the same way as other is_ functions in WordPress.
Do let me know if you have any question.
Mohammed Kaludi
Hi AzMark,
Sorry, that doesn’t work for my situation. I’m inserting content (a newsletter signup form, in this case) at the end of every post via a plugin. I need to be able to check via php whether the post is being shown on an AMP page, so I can stop the signup form from being shown in that case.
At the moment, it shows the signup and thankyou text on AMP pages, but the form itself is stripped out, so it’s very confusing for readers.
Hi Mohammed,
That’s perfect, thanks! I’ll test it out today. 🙂
Cheers,
DAve
@obilix99
If it works, then please share it with the Community, it will help us.
Regards,
Ahmed
Yup, it worked perfectly — thanks! I just put:
<?php if ( !is_amp_endpoint() ) {
above the newsletter code block, and
<?php } ?>
afterwards, to keep it from being displayed on AMP pages.