预期会通过Google结构化数据测试工具执行以下操作:
<div>
<div itemprop="publisher" itemscope id="organization-example" itemtype="https://schema.org/Organization">
<a itemprop="url" href="https://example.com">
<img itemprop="image logo" src="https://example.com/images/logo.png" alt="LOGO">
<span itemprop="name">EXAMPLE</span>
<span itemprop="description">This is an EXAMPLE</span>
</a>
</div>
</div>
<div itemscope itemtype="https://schema.org/WebPage" itemref="organization-example">
</div>
但是当我尝试使用a时BlogPosting
会破坏logo
属性:
<div>
<div itemprop="publisher" itemscope id="organization-example" itemtype="https://schema.org/Organization">
<a itemprop="url" href="https://example.com">
<img itemprop="image logo" src="https://example.com/images/logo.png" alt="LOGO">
<span itemprop="name">EXAMPLE</span>
<span itemprop="description">This is an EXAMPLE</span>
</a>
</div>
</div>
<article
itemscope
itemtype="https://schema.org/BlogPosting"
itemref="organization-example"
>
</article>
与错误:
https://example.com/images/logo.png
(属性logo.itemtype具有无效值。)
谁能解释为什么?我可以采取哪些步骤来修复它?
@SimonHayter谢谢,但是Publisher不是Organization的子级,而Organization在WebPage的顶部,因此我想从BlogPosting引用它。.您是否建议使用Organization-> BlogPosting-> Publisher结构?这似乎不正确。
—
Arth
—
Arth
金发碧眼的时刻,我完全错了。我稍后再看:)
—
西蒙·海特
itemprop
与相同的行itemtype
,因为发布者是Organization,WebPage和BlogPosting的子级。最好<body itemscope itemtype="https://schema.org/Organization">
再用<article itemscope itemtype="https://schema.org/BlogPosting">
<span itemprop="publisher">
等等。。。不需要重复多次徽标,尤其是在博客文章中。