"博客不是mainContentOfPage"的已知有效目标类型。

时间:2015-09-30 16:22:42

标签: wordpress schema.org microdata

  

Blog不是mainContentOfPage属性的已知有效目标类型。

我已经尝试了很多选项来http://www.thecreativedev.com

设置mainContentOfPage属性

我有

<div itemprop="mainContentOfPage" itemscope="itemscope" itemtype="http://schema.org/Blog"> --> This is outside the loop

<div itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost"> --> This is in loop

但没有解决方案有效。我尝试了在Best way to markup "mainContentOfPage"?

上提供的解决方案

任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:3)

我怀疑你不想使用mainContentOfPage property。它对普通网页来说并不是很有用,因为它需要WebPageElement作为值(表示导航,页脚或侧边栏等内容),而不是实际上的主要内容一个页面(如博客文章)。

如果您想表示BlogWebPage的主要内容(例如,在博客的主页上),您可能需要使用mainEntity property(并且另一个方向,反向属性mainEntityOfPage)。

它可能看起来像这样(使用Microdata):

<body itemscope itemtype="http://schema.org/WebPage">
  <section itemprop="mainEntity" itemscope itemtype="http://schema.org/Blog">
    <article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting"></article>
    <article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting"></article>
    <article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting"></article>
  </section>
</body>
相关问题