Itemprop错误

时间:2016-04-28 15:00:15

标签: html wordpress

我检查了我的博客文章'在validator.w3.org上的页面,它会一直显示这个错误:

错误1

The **itemprop** attribute was specified, but the element is not a property of any item.

我的博客代码:

<h1 class="blogtitle entry-title" itemprop="itemReviewed" itemscope itemtype="http://schema.org/Thing">↩
<span itemprop="name">The article title</span>↩
</h1>

错误2

The itemprop attribute was specified, but the element is not a property of any item.

代码:

<h1 class="blogtitle entry-title" itemprop="itemReviewed" itemscope itemtype="http://schema.org/Thing">↩
<span itemprop="title">Article title</span>
</h1>

因此在该代码中我有2个itemprop错误。

然后错误3

The itemprop attribute was specified, but the element is not a property of any item.

代码:

<a href="http://www.website.com/author/Siteauthors"  itemprop="author" target="_blank"><span class="vcard author author_name"><span class="fn">Siteauthors</span></span></a>

那我该如何解决这个错误呢?我希望我的页面没有错误,只有这些错误!我读了一些关于这个&#34; itemtrop&#34;的文章。但我不太了解!

欢迎任何帮助!!!!!

1 个答案:

答案 0 :(得分:2)

您必须明确提供属性(以及属性的类型)。为此,您需要在itemtype代码中添加<html>

在您的特定实例中,您需要更改:

<html lang="en-US">

为:

<html lang="en-US" itemscope itemtype="http://schema.org/WebPage">

它将成功验证。

在Schema.org中,一切都是ThingThing有许多子类型,列在&#34;更具体的类型&#34;。从那里开始,为您的内容选择最具体的类型。在此示例中,我选择了WebPage,但您可以选择任何类型。

感谢:https://stackoverflow.com/a/29124838/836695