Can you please elaborate a little bit more on your issue once to a better understanding of the issue? So that we will assist you accordingly to resolve it.
i use your function ampforwp_is_amp_endpoint() in my theme to not add content in amp page.
But ampforwp_is_amp_endpoint() always return false; in amp page request too.
I can’t do more simple to explain it !
Can you please let me know, do you enabled the AMP takeover at your end?
AMP Takeover is not enabled
Can you please refer the following code for checking the AMP endpoint and let us know back?
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
if( function_exists('ampforwp_is_amp_inURL') && ampforwp_is_amp_inURL($url_path)) {
//Your Code Here
}
yes here it’s work.
i’m already make a patch to detect amp page with url before but it’s reliable ?
why ampforwp_is_amp_endpoint() doesn’t work ?
thanks
Yes, sometimes it doesn’t work based on scenarios but good to hear that this is working fine.