• Resolved acorroy

    (@acorroy)


    Hello,

    i need help with your function ampforwp_is_amp_endpoint, it’s always return false on amp page or not amp page so i can’t use it.

    Any other way ?

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    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.

    Thread Starter acorroy

    (@acorroy)

    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 !

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Can you please let me know, do you enabled the AMP takeover at your end?

    Thread Starter acorroy

    (@acorroy)

    AMP Takeover is not enabled

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    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
        }
    Thread Starter acorroy

    (@acorroy)

    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

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Yes, sometimes it doesn’t work based on scenarios but good to hear that this is working fine.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘ampforwp_is_amp_endpoint() return false’ is closed to new replies.