質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
AMP(Accelerated Mobile Pages)

AMP(Accelerated Mobile Pages)は、Google社を始め複数のプラットフォームが共同で参加しているプロジェクト。モバイルユーザーのUX向上を目的とし、モバイルページの表示速度の高速化を図っています。

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

Q&A

0回答

1123閲覧

wordpressでのAMP対応

naonao11

総合スコア97

AMP(Accelerated Mobile Pages)

AMP(Accelerated Mobile Pages)は、Google社を始め複数のプラットフォームが共同で参加しているプロジェクト。モバイルユーザーのUX向上を目的とし、モバイルページの表示速度の高速化を図っています。

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

0グッド

0クリップ

投稿2018/07/19 05:43

編集2018/07/19 06:42

現在ローカルでサイトのamp対応を行っているのですが,#development=1つけデバッグしコンソール画面で確認した際にエラーが大量に出てきます。
以下そのエラーです。

941:2:0 The mandatory attribute '⚡' is missing in tag 'html ⚡ for top-level html'. 941:8:0 The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value '/shared/css/import.css'. 941:9:0 The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value '/shared/css/mobile.css'. 941:10:0 The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value '/shared/css/mobile.css'. 941:37:0 Custom JavaScript is not allowed. 941:38:0 Custom JavaScript is not allowed. 941:39:0 Custom JavaScript is not allowed. 941:82:22 The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? 941:89:16 The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? 941:96:2 Invalid URL protocol 'http:' for attribute 'action' in tag 'FORM [method=GET]'. 941:96:2 The tag 'FORM [method=GET]' requires including the 'amp-form' extension JavaScript. 941:100:6 The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? 941:154:0 Custom JavaScript is not allowed. 941:162:12 The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? 941:170:21 Invalid URL protocol 'javascript:' for attribute 'href' in tag 'a'. 941:175:0 Custom JavaScript is not allowed. 941:188:2 Custom JavaScript is not allowed. 941:195:11 The mandatory tag 'link rel=canonical' is missing or incorrect. 941:195:11 The mandatory tag 'meta name=viewport' is missing or incorrect. 941:195:11 The mandatory tag 'amphtml engine v0.js script' is missing or incorrect. 941:195:11 The mandatory tag 'noscript enclosure for boilerplate' is missing or incorrect. 941:195:11 The mandatory tag 'head > style[amp-boilerplate]' is missing or incorrect. 941:195:11 The mandatory tag 'noscript > style[amp-boilerplate]' is missing or incorrect.

またコードについては以下に載せます。

<!doctype html> <html amp> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> <title> sample1</title> <link rel="canonical" href="http://sample/aaa/941" > <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> <script async src="https://cdn.ampproject.org/v0.js"></script> <style amp-custom> body { font-size: 15px; margin: 0; padding: 0; line-height: 1.6; color: #222; font-size: 16px; } header { display: block; width: 100%; height: 55px; box-sizing: content-box; box-shadow: 0px 0px 10px #555; } body { font-size: 15px; margin: 0; padding: 0; line-height: 1.6; color: #222; font-size: 16px; } header { display: block; width: 100%; height: 55px; box-sizing: content-box; background: #fff; box-shadow: 0px 0px 10px #555; } h1 { font-size: 2em; } .contentBox { overflow: hidden; width: 100%; margin-top: 40px; padding: 0; } .contentBox li { width: 46%; margin: 5px; text-align: center; float: left; display: table-cell; list-style-type: none; background-color: #ffc; } .contentBox li a { padding: 30px 0; display: block; text-decoration: none; } footer { border-bottom: 1px solid #d6434b; font-size: 14px; line-height: 1.5; width: 100%; background: #960e15; } footer nav { padding: 20px 0; } footer ul li { display: inline; margin-right: 3px; } footer ul li a { color: #fff; text-decoration: none; } footer div small { color: #d6434b } </style> <script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script> </head> <body> <header> <div> <a href="/"><amp-img src="/shared/img/header_zan_logo.png" width="250px" height="30px" alt="画像名"></amp-img></a> </div> </header> <div> <div> <main> <div class="columnContent"> <h1 class="single_title">sample1</h1> <time datetime="2018年7月18日">2018年7月18日</time> <amp-img alt="" src="http://sample/wp/wp-content/eyecatch.jpg" width="360px" height="240px" layout="fixed"></amp-img> </div> <ul class="contentBox"> <li><a href="/">トップ</a></li> <li><a href="/column/category/ccc">ccc</a></li> <li><a href="/column/category/bbb">bbb</a></li> <li><a href="/column/category/xxx">xxx</a></li> <li><a href="/column/category/zzz">zzz</a></li> <li><a href="/column/category/www">www</a></li> </ul> </main> </div> </div> <footer> <div> <nav> <ul> <li><a href="/contact/">お問い合わせ</a> | </li> <li><a href="/term/">利用規約</a></li> </ul> </nav> </div> <div> <small>Copyright © Zeal Athlete Agency Inc. All Right Reserved.</small> </div> </footer> <amp-analytics type="googleanalytics" id="analytics1"> <script type="application/json"> { "vars": { "account": "UA-11111111-1" }, "triggers": { "trackPageview": { "on": "visible", "request": "pageview" } } } </script> </amp-analytics> </body> </html>

必須タグについては書き,禁止タグについては省いているのでここまでエラーが出るのがわかりません。
ご助力お願いいたします・・・

追記

https://validator.ampproject.org/
で上のコードを見てみるとValidation Status: PASS と出てきます。
これはローカル環境だからエラーが出ていたということなのでしょうか。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問