Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @utnalove,

    To add it in the header, you can use amp_post_template_head hook.

    or to add in the structured data, you can use amp_post_template_metadata.

    Do let me know if you need any more help regarding this. Or you can contact us through ampforwp.com/support/

    Thread Starter utnalove

    (@utnalove)

    Unfortunately none of them is working. Cache plugin is off, cache is disabled, I tried also in incognito mode,etc.
    The custom fields are being saved, howerver in the HTML of the custom pages it’s not working.

    So I see 2 problems:
    1) nor amp_post_template_head nor amp_post_template_metadata is working – in the html it’s not there.
    2) In the settings it’s possible to set that the SEO plugin is Yoast, however AMP for WP is not fully compatible with yoast.

    I am trying to add LocalBusiness schema to the AMP page. But it is not working.
    If you see the structured data here https://www.anahatatantra.com/pl/ you can see that there are LocalBusiness info added by Yoast.
    But in the AMP pages it’s not there: https://www.anahatatantra.com/pl/amp/

    I am trying to add it manually in the header by either one of those two custom fields you provided, but it’s not working.

    The best solution would be to make the plugin fully compatible with Yoast SEO and Yoast Local SEO.

    Then… it would be good to troubleshoot why those custom fields are not working.

    Thank you, and I hope u can help

    Thread Starter utnalove

    (@utnalove)

    I added manually via widgets…. problem 2 solved.
    problem 1 not yet

    @utnalove

    How are you using the amp_post_template_head and amp_post_template_metadata?

    Thread Starter utnalove

    (@utnalove)

    I add it this way. Here you can see: https://i.imgur.com/SygvIhh.png

    Hi @utnalove,

    No, I am sorry if I was not clear. This is not the correct way.

    amp_post_template_head is the hook and amp_post_template_metadata is a filter. So you have to code it accordingly.

    I would suggest you check how hooks and filters work in WordPress for better understanding.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to add custom Schema to some specific AMP posts?’ is closed to new replies.