Need support for Amp Implementation
-
Based on the information provided in the ‘Completely Override CSS’ section of the link https://github.com/Automattic/amp-wp.
We have created the amp folder in our theme and added the file called style.php, then we have specified the custom template using the amp_post_template_file filter for ‘style’ === $type. As we wanted the Amp page to be same as our blog page we also overrided the default template using the amp_post_template_file filter and passed it with our custom template path.
So the newly created amp folder now includes custom files such as style.php, my-single.php, header.php, footer.php.
But there are many errors in the console.1) error : The author stylesheet specified in tag ‘style amp-custom’ is too long the limit is 50000 bytes.
Is there any way to include more than one style sheet? If yes, then how it can be done.
2)error :The attribute ‘href’ in tag ‘link rel=stylesheet for fonts’ is set to the invalid value
How to include the following fonts in amp?
http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,300,400italic,600italic,300italic,700italic,800,800italic’
http://fonts.googleapis.com/css?family=Poiret+One’
http://fonts.googleapis.com/css?family=Indie+Flower&text=NEW’3) error: The tag ‘script’ is disallowed except in specific forms.
we have few script files.
How to include these scripts in amp.
<script src=”//abc.com/js/123456.js” async=”true”></script>
<script async src=”//XYZ.com/t.js” async=”true”></script>4) error :Invalid URL protocol ‘javascript:’ for attribute ‘href’ in tag ‘a’.
We have defined the popup() function in the script, but we are getting the above error.How to make it work.
5) error:The attribute ‘type’ in tag ‘input’ is set to the invalid value ‘button’.
How to make below code to work.
<input type=”button” value=”Subscribe” onclick=”subscribe()”/>6) error: The attribute ‘async’ may not appear in tag ‘link rel=’. (see https://www.ampproject.org/docs/reference/spec.html#html-tags)
How to add the below line in amp.
<link href=”https://abc.com/1234″ async=”true” rel=”publisher” />7)The attribute ‘action’ may not appear in tag ‘FORM [method=POST]’.
How to add this form action attribute in amp.
<form id=”form” action=”http://abc/def/form.php” method=”post”>
The topic ‘Need support for Amp Implementation’ is closed to new replies.