0
votes

I' m trying to add microdata on my website but i meet difficulties.

on an categorie page of a wordpress I'm trying to add multiple http://schema.org/BlogPosting

  • one for the content and description of the category
  • and one of each article summary

But and I check on https://search.google.com/structured-data/testing-tool I everytime get a problem to add publisher. But as is always the same I guess I should have to redefine each time? so how can I add reference?

Or do I follow a wrong way by trying to add multiple itemscope?

<body>
<div itemscope itemtype="http://schema.org/Blogposting">
    <header role="banner" id="headertop" itemscope itemtype="https://schema.org/Organization" itemprop="publisher" itemref="blockfanfb mypaqe_footer">
        <div  itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
            <a id="header_logo" href="http://www.mywebsite/" title="mywebsite"><img itemprop="url" src="http://www.mywebsite/img/logo-4.jpg" alt="mywebsite" width="130" height="68"/></a>
            <meta itemprop="width" content="130">
            <meta itemprop="height" content="68">
            <a href="http://www.mywebsite/" title="mywebsite" itemprop="name" > MYWEBSITE</a>
        </div>
        <nav itemscope itemtype="http://schema.org/BreadcrumbList">
            <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
                <a itemscope itemtype="http://schema.org/Thing" itemprop="item" href="http://www.mywebsite/">
                <span itemprop="name">My site</span></a>
                <meta itemprop="position" content="1" />
            </span> › 
            […]
        </nav>
    </header>
    <main role="main">
        <article id="container" itemprop="articleBody">
            <meta itemscope itemprop="mainEntityOfPage"  itemType="https://schema.org/WebPage" itemid="http://mywebsite.com/blog/cat/"/>
              <header class="iframe-responsive-wrapper">
                <h1 itemprop="headline" class="page-title">Nvel catégorie</h1>
                <p itemprop="author" itemscope itemtype="https://schema.org/Person">By <span itemprop="name">Me</span></p>
                <time itemprop="datePublished" datetime="2016-11-24T13:01:32+00:00">2016-11-24T13:01:32+00:00</time>
                <time class="updated" itemprop="dateModified"  datetime="2016-11-24T13:56:51+00:00">2016-11-24T13:56:51+00:00</time>
            </header>
        <div>
            <div class="category-description">
                <p>test</p>
                <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
                    <img src="http://mywebsite.com/image.jpg" />
                    <meta itemprop="url" content="http://mywebsite.com/image.jpg">
                    <meta itemprop="width" content="1024">
                    <meta itemprop="height" content="1365">
                </div>
            </div>
        </div>
    <footer>
    <hr>
    Other article
    <hr>
    <section>
        <!-- ARTICLE 1 -->
        <div itemscope itemtype="http://schema.org/BlogPosting">
            <meta itemscope itemprop="mainEntityOfPage"  itemType="https://schema.org/WebPage" itemid="http://mywebsite.com/cat/article1/"/>
            <meta itemprop="publisher" itemref="headertop blockfanfb mypaqe_footer">
            <h3 class="entry-title" itemprop="headline"><a href="http://mywebsite.com/blog/new/image-en-direct-extrait-et-headline/" title="ARTICLE" itempropp="url" rel="bookmark">ARTICLE</a></h3>
            <div>
                <time itemprop="datePublished" datetime="2016-11-24T13:01:32+00:00">2016-11-24T13:01:32+00:00</time>
                <time class="updated" itemprop="dateModified"  datetime="2016-11-24T13:56:51+00:00">2016-11-24T13:56:51+00:00</time>
            </div>
            <span itemprop="author" itemscope itemtype="https://schema.org/Person">By <a href="https://plus.google.com/+Me?rel=author" rel="nofollow"><span itemprop="name">ME</span></a></span>
            <div  class="image-article-list" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
                <img width="150" height="150" src="http://mywebsite.com/image.jpg" class="attachment-thumbnail" /
                <meta itemprop="url" content="http://mywebsite.com/image.jpg">
                <meta itemprop="width" content="150">
                <meta itemprop="height" content="150">
            </div>
            <div class="resume-article-list">"Lorem ipsum dolor sit amet, [~]</div>     </div>
        </div>
        <!-- ARTICLE 2 -->
        <div itemscope itemtype="http://schema.org/BlogPosting">
            <meta itemscope itemprop="mainEntityOfPage"  itemType="https://schema.org/WebPage" itemid="http://mywebsite.com/cat/article1/"/>
            <meta itemprop="publisher" itemref="headertop blockfanfb mypaqe_footer">
            <h3 class="entry-title" itemprop="headline"><a href="http://mywebsite.com/blog/new/image-en-direct-extrait-et-headline/" title="ARTICLE2" itempropp="url" rel="bookmark">ARTICLE2</a></h3>
            <div>

                <time itemprop="datePublished" datetime="2016-11-24T13:01:32+00:00">2016-11-24T13:01:32+00:00</time>
                <time class="updated" itemprop="dateModified"  datetime="2016-11-24T13:56:51+00:00">2016-11-24T13:56:51+00:00</time>
            </div>
            <span itemprop="author" itemscope itemtype="https://schema.org/Person">By <a href="https://plus.google.com/+Me?rel=author" rel="nofollow"><span itemprop="name">ME</span></a></span>
            <div  class="image-article-list" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
                <img width="150" height="150" src="http://mywebsite.com/image.jpg" class="attachment-thumbnail" /
                <meta itemprop="url" content="http://mywebsite.com/image.jpg">
                <meta itemprop="width" content="150">
                <meta itemprop="height" content="150">
            </div>
            <div class="resume-article-list">"Lorem ipsum dolor sit amet, [~]</div>     </div>
        </div>

    </section>

        </footer>

</article>
    </main>
    <footer role="contentinfo">
        […]
        <div id="mypaqe_footer" itemscope itemtype="http://schema.org/Corporation">
            À propos de <span itemprop="name">mywebsite</span>
            <meta itemprop="url" content="http://www.mywebsite">
            <p itemprop="description">blla bla <time itemprop="foundingDate" datetime="2013-01-01">2013</time> par l'<span itemprop="founders">me</span></p><br />
            Contact<br />
            <p id="contact">
                <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
                    <span itemprop="streetAddress">2405 street</span><br />
                    <span itemprop="postalCode">9999</span>
                    <span itemprop="addressLocality">bépo</span>,<br />
                    <meta itemprop="addressCountry" content="FR" />France
                </span><br />
                <span id="contact" itemprop="contactPoint" itemscope itemtype="http://schema.org/ContactPoint">
                <a href="mailto:contact@mywebsite" itemprop="email">contact@mywebsite</a><br />
                <meta itemprop="contactType" content="customer support">
                Tel:<span itemprop="telephone">+33-9-12341234</span>,<span id="drapeau" class="sprite"></span>
                </span>
            </p>
        </div>
        <div>
            <div id="blockfanfb">
                <div id="fb-root"></div>
                <a href="https://www.facebook.com/pages/me/123412342596423"> </a>
            </div>
            <div>
                <a class="sprite" href="http://twitter.com/#!/mywebsite/"></a>
                <a class="sprite" href="http://pinterest.com/mywebsite/"></a>
            </div>
        </div>

    </footer>
    </body>
</html>
1

1 Answers

1
votes

How to use Microdata’s itemref

The way you use itemref is not correct.

You have to specify the itemprop on the element you want to reference, not on the element that references.

So the structure could look like this:

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="corp">
</article>

<article itemscope itemtype="http://schema.org/BlogPosting" itemref="corp">
</article>

<div id="corp" itemprop="publisher" itemscope itemtype="http://schema.org/Corporation">
</div>

(I assume that the items Corporation and Organization are about the same entity in your case. If that’s true, you shouldn’t have both.)

Notes about your use of Schema.org

It’s not correct to use the BlogPosting type for a category in a blog.

I think in your case it makes sense to use CollectionPage, which also allows you to add your BreadcrumbList via the breadcrumb property.

<div itemscope itemtype="http://schema.org/CollectionPage">

  <nav itemprop="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">
  </nav>

</div>

Each blog post could be added via hasPart, or you could add an ItemList as mainEntity of the CollectionPage.