很难处理JSON和几个blogPost。在我看来,Microdata one和JSON-DL one都是完全相同的,而后者只显示一个blogPost,其中Microdata同时显示两者。
HTML微数据标记:
<body itemscope itemtype="https://schema.org/Blog">
<header>...</header>
<article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<h1 itemprop="headline">Article Heading One</h1>
</article>
<article itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<h1 itemprop="headline">Article Heading Two</h1>
</article>
</body>JSON-DL标记:
<script type="application/ld+json">
{
"@context":"http://schema.org",
"@type":"Blog",
"blogPost":{
"@type":"blogPosting",
"headline":"Article Heading One"
},
"blogPost":{
"@type":"blogPosting",
"headline":"Article Heading Two"
}
}
</script>复制到这里测试:https://search.google.com/structured-data/testing-tool/u/0/
有人看到什么不对劲了吗?
发布于 2016-08-21 16:27:26
台风..。尝试了几个不同的方法几个小时后,我问了几分钟,我自己解决了.
无论如何,获得几个blogPosts的正确代码如下:
<script type="application/ld+json">
{
"@context":"http://schema.org",
"@type":"Blog",
"blogPosts":
[
{
"@type":"blogPosting",
"headline":"Article Heading One"
},
{
"@type":"blogPosting",
"headline":"Article Heading Two"
}
]
}
</script>将使用它来标记每个博客,如索引站点,猜猜这就是它的目的:)
https://webmasters.stackexchange.com/questions/98547
复制相似问题