Wednesday, 15 February 2017

Cara Membuat Schema.org Untuk Blogspot

Schema.org

Sebenarnya tidak ada petunjuk khusus untuk membuat schema.org yang sesuai dengan keinginan google agar sesuai susunanya di blogspot. Cara ini saya dapat pada saat mengetes blog saya ini di structured data tools ternyata terdapat error pada susunan schema.org. Setelah coba cari dan tanya di forum kemudian memberanikan sedikit rubah kode scriptnya akhirnya berhasil dan tidak ditemukan lagi error pada schema.org di blog saya ini.

Cara pemasangannya cukup mudah sobat tinggal sesuaikan saja structured kodenya pada template blog sobat. Nah bagi yang ingin mencoba Cara Membuat Schema.org Untuk Blogspot dan menggunakan structured schema.org yang saya gunakan ini silahkan dicoba dan sesuaikan dengan templated yang sobat gunakan.
Susunan kode yang saya berikan dibawah ini dimulai dari kode <body> paling atas terus sampai ke penutupnya </body>. Sebelum menggunakannya perhatikan baik-baik tiap detil barisnya atau kalau perlu di backup terlebih dahulu templatenya untuk berjaga jika terjadi error nanti sobat bisa kembalikan setingan sebelumnya. Silahkan di simak dan dicoba.

<body itemscope='itemscope' itemtype='http://schema.org/WebPage'>
<div itemprop='mainContentOfPage' itemscope='itemscope' itemtype='https://schema.org/WebPageElement'>
<nav class='page-menu' itemprop='mainEntity' itemscope='itemscope' itemtype='http://schema.org/SiteNavigationElement'>
 <ul>
   <li><a expr:href='data:blog.homepageUrl' expr:title='data:blog.title' itemprop='url'><span itemprop='name'>Home</span></a></li>
   <li><a href='#' itemprop='url' title='About'><span itemprop='name'>About</span></a></li>
   <li><a href='#' itemprop='url' title='Contact'><span itemprop='name'>Contact</span></a></li>
   <li><a href='#' itemprop='url' title='Privacy'><span itemprop='name'>Privacy</span></a></li>
   <li><a href='#' itemprop='url' title='Sitemap'><span itemprop='name'>Sitemap</span></a></li>
   </ul>
</nav>
<div id='search-box'>
<div itemprop='mainEntity' itemscope='itemscope' itemtype='http://schema.org/WebSite'>
<meta content='http://blogsobat.com/' itemprop='url'/>
<form action='/search' itemprop='potentialAction' itemscope='itemscope' itemtype='http://schema.org/SearchAction' method='get'>
<meta content='/search?q={q}' itemprop='target'/>
<input id='search-form' itemprop='query-input' name='q' placeholder='input here and hit enter' required='required' type='text'/>
  </form>
  </div>
  </div>
<div class='sos-profil'>
<div itemprop='mainEntity' itemscope='itemscope' itemtype='http://schema.org/Person'>
  <link href='http://blogsobat.com/' itemprop='url'/>
<ul>
  <li><a href='//www.youtube.com/c/usersobat' itemprop='sameAs' target='_blank' title='Youtube'>Youtube</a></li>
  <li><a href='//id.linkedin.com/in/usersobat' itemprop='sameAs' target='_blank' title='LinkedIn'>LinkedIn</a></li>
  <li><a href='https://www.google.com/+usersobat' itemprop='sameAs' target='_blank' title='Google+'>Google+</a></li>
  <li><a href='https://twitter.com/usersobat' itemprop='sameAs' target='_blank' title='Twitter'>Twitter</a></li>
  <li><a href='https://www.facebook.com/usersobat' itemprop='sameAs' target='_blank' title='Facebook'>Facebook</a></li>
  </ul>
  </div>
</div>
<header itemprop='mainEntity' itemscope='itemscope' itemtype='http://schema.org/WPHeader'>
<div id='header-wrapper'>
      <div class='titlewrapper'>
        <b:if cond='data:blog.pageType != &quot;item&quot;'>
        <h1 class='title' itemprop='headline'>
<b:include name='title'/>
        </h1>
<b:else/>
        <p class='title' itemprop='headline'>
          <b:include name='title'/>
        </p>
</b:if>
      </div><b:include name='description'/>
    </div>
          <b:includable id='description'>
             <p class='description' itemprop='description'><span><data:description/></span></p>
          </b:includable>
          <b:includable id='title'>
             <a expr:href='data:blog.homepageUrl' expr:title='data:title' itemprop='url'><span itemprop='name'><data:title/></span></a>
          </b:includable>
  </div>
      </header>
<div id='outer-wrapper'>
<div itemscope='itemscope' itemtype='http://schema.org/Blog'>
              <b:includable id='post' var='post'>
  <article class='post hentry' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'>
<b:if cond='data:post.firstImageUrl'>
<div itemprop='image' itemscope='itemscope' itemtype='https://schema.org/ImageObject'>
  <meta expr:content='data:post.firstImageUrl' itemprop='url'/>
  <meta content='700' itemprop='width'/>
  <meta content='700' itemprop='height'/>
  </div>
    </b:if>
  <div itemprop='publisher' itemscope='itemscope' itemtype='https://schema.org/Organization'>
    <div itemprop='logo' itemscope='itemscope' itemtype='https://schema.org/ImageObject'>
      <meta content='https://1.bp.blogspot.com/-qkMsPC08u0o/WA75l1dBnbI/AAAAAAAAAKc/QecXrIpz_SgQx19gTEy1CNuawSF9SCyawCLcB/s400/logo.png' itemprop='url'/>
      <meta content='600' itemprop='width'/>
      <meta content='600' itemprop='height'/>
    </div>
    <meta expr:content='data:blog.title' itemprop='name'/>
  </div>
    <b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:if cond='data:post.title'>
      <h2 class='post-title entry-title' itemprop='headline'>
     <b:if cond='data:post.link'>
       <a expr:href='data:post.link' expr:title='data:post.title' itemprop='url mainEntityOfPage'><data:post.title/></a>
     <b:else/>
        <b:if cond='data:post.url'>
          <a expr:href='data:post.url' expr:title='data:post.title' itemprop='url mainEntityOfPage'><data:post.title/></a>
        <b:else/>
          <data:post.title/>
        </b:if>
     </b:if>
      </h2>
</b:if>
<b:else/>
<div id='judul-post'>
      <h1 class='post-title entry-title' itemprop='headline'>
     <b:if cond='data:post.link'>
       <a expr:href='data:post.link' expr:title='data:post.title' itemprop='url mainEntityOfPage'><data:post.title/></a>
     <b:else/>
        <b:if cond='data:post.url'>
          <a expr:href='data:post.url' expr:title='data:post.title' itemprop='url mainEntityOfPage'><data:post.title/></a>
        <b:else/>
          <data:post.title/>
        </b:if>
     </b:if>
      </h1>
</div>
</b:if>
<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
<div class='postmeta'>
<h3 class='date-header'>
<a class='updated' expr:href='data:post.url' rel='bookmark' title='permanent link'><abbr class='published' expr:title='data:post.timestampISO8601' itemprop='datePublished dateModified'> <data:post.timestamp/></abbr></a></h3>
</div>
</b:if>
    <div class='post-body entry-content' expr:id='&quot;post-body-&quot; + data:post.id' itemprop='articleBody'>
<b:if cond='data:blog.pageType != &quot;static_page&quot; and data:blog.pageType != &quot;item&quot;'>
<div class='postmeta'>
<h3 class='date-header'>
<a class='updated' expr:href='data:post.url' rel='bookmark' title='permanent link'><abbr class='published' expr:title='data:post.timestampISO8601' itemprop='datePublished dateModified'> <data:post.timestamp/></abbr></a></h3>
</div>
  </b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div class='postmeta'>
<h3 class='date-header'>
<a class='updated' expr:href='data:post.url' rel='bookmark' title='permanent link'><abbr class='published' expr:title='data:post.timestampISO8601' itemprop='datePublished dateModified'> <data:post.timestamp/></abbr></a></h3>
</div>
</b:if>
  </article>
</b:includable>
  </div>
</div>
<div itemprop='mainEntity' itemscope='itemscope' itemtype='https://schema.org/WPSideBar'>
<aside id='sidebar'>
<div id='sidebar1'>
        <b:section class='sidebar' id='sidebar' preferred='yes'>
          <b:widget id='PopularPosts1' locked='false' title='Posts Of The Week' type='PopularPosts'>
            <b:includable id='main'>
  <b:if cond='data:title != &quot;&quot;'><h2 itemprop='name headline'><data:title/></h2></b:if>
  <div class='widget-content popular-posts'>
    <ul>
      <b:loop values='data:posts' var='post'>
      <li>
        <b:if cond='!data:showThumbnails'>
          <b:if cond='!data:showSnippets'>
            <!-- (1) No snippet/thumbnail -->
            <a expr:href='data:post.href' itemprop='url'><data:post.title/></a>
          <b:else/>
            <!-- (2) Show only snippets -->
            <div class='item-title'><a expr:href='data:post.href' itemprop='url'><data:post.title/></a></div>
            <div class='item-snippet' itemprop='description'><data:post.snippet/></div>
          </b:if>
        <b:else/>
          <!-- (3) Show only thumbnails or (4) Snippets and thumbnails. -->
          <div expr:class='data:showSnippets ? &quot;item-content&quot; : &quot;item-thumbnail-only&quot;'>
            <b:if cond='data:post.thumbnail'>
              <div class='item-thumbnail'>
                <a expr:href='data:post.href' itemprop='url' target='_blank'>
                  <img expr:alt='data:post.title' expr:src='data:post.thumbnail' expr:height='data:thumbnailSize' expr:title='data:post.title' expr:width='data:thumbnailSize' itemprop='image'/>
                </a>
              </div>
            </b:if>
            <div class='item-title'><a expr:href='data:post.href' expr:title='data:post.title' itemprop='url'><data:post.title/></a></div>
            <b:if cond='data:showSnippets'>
              <div class='item-snippet' itemprop='description'><data:post.snippet/></div>
            </b:if>
          </div>
          <div style='clear: both;'/>
        </b:if>
      </li>
      </b:loop>
    </ul>
  </div>
              </b:if>
</b:includable>
          </b:widget>
        </b:section>
      </div>
</aside>
</div>
<footer itemprop='mainEntity' itemscope='itemscope' itemtype='http://schema.org/WPFooter'>
<div class='credit'>
Copyright &#169; <span itemprop='copyrightYear'>2016</span> <span itemprop='copyrightHolder' itemscope='itemscope' itemtype='https://schema.org/Organization'><a expr:href='data:blog.homepageUrl' expr:title='data:blog.title' itemprop='url'><span itemprop='name'><data:blog.title/></span></a></span>
</div>
</footer>
</div>
</body>

Jika sudah di salin sebelum di simpan silahkan sesuaikan dengan templated sobat terutama pada URL yang terkoneksi di blog sobat, jika ada yang ingin disesuaikan dan disempurnakan atau ingin menambahkan silahkan. Susunan Schema.org yang saya posting ini bukan berarti yang paling bagus ya minimal bisa membantu mengatasi masalah error di structured data tool.


EmoticonEmoticon