On the edit page screen, look in the Publish settings (metabox). There is an AMP line there. Does it say Enabled or Disabled? Pages with custom templates assigned are AMP-disabled by default. I see you do mention that AMP is enabled for this specific page, but can you confirm this?
Otherwise, I can see that https://lindesvard.se/copywriter-stockholm/?amp is indeed redirecting to https://lindesvard.se/copywriter-stockholm/ as if AMP is not enabled.
This is where the redirect is happening I believe: https://github.com/Automattic/amp-wp/blob/cceaffb9c67b7a40c401d36d1eed00e9d1666d72/amp.php#L180-L184
So I think post_supports_amp() is returning false for you, but I am not sure why. Here is the logic for determining what to return: https://github.com/Automattic/amp-wp/blob/cceaffb9c67b7a40c401d36d1eed00e9d1666d72/includes/amp-helper-functions.php#L66-L106
Thank you for your response. Yes, I can confirm that the setting in the metabox is enabled.
True that the setting was disabled by default. It’s a custom page template. I changed it manually.
Is there something I have to add to my functions.php file?
There shouldn’t be any code changes needed at all to enable page support. Everything should be doable from the admin, via the AMP > General options page and then opt-in for specific pages when required.
Please take a look at this thread as it might be the problem you’re having: https://ww.wp.xz.cn/support/topic/0-6-0-not-working-for-pages/#post-9903600
Thank you @westonruter, I will dig into that.
I had the same problem. Finally I found that it was related to the Yoast SEO plugin. This plugin requires to enable amp support for pages in it’s amp settings section. After I enabled amp pages additionaly in Yoast, things worked fine. https://dasbestebuchderwelt.de/sprueche-und-zitate-zum-reisen/?amp
Thank you @crischo! That worked for me too. What a ridiculous little problem.
I have the same problem. I did both the amp admin settings and the yoast settings as suggested here. Still having the same issue with amp data not being created. please help.
@guardian88 You’ll have to share the URL for your site.