模式结构化标记

时间:2017-05-18 13:35:47

标签: html schema structured-data

我正在尝试将一些结构化标记应用于TheatreEvent。下面是我正在使用的代码:

 <!-- MAIN CONTENT -->

  <div class="container" itemscope itemtype="http://schema.org/TheaterEvent">   

    <div class="col-md-3">

      <div class="event-details">
        <h3>Event Info</h3>
        <p itemprop="startDate"><strong>Date: </strong><?php the_field('date_of_event'); ?></p>
        <p itemprop="doorTime"><strong>Time: </strong><?php the_field('start_time'); ?> – <?php the_field('end_time'); ?></p>
        <p><strong>Price: </strong><?php the_field('price'); ?></p>
        <p><strong>Venue: </strong><?php the_field('venue'); ?></p>
      </div>
      <div class="book-event-button">
        <a href="<?php the_field('button_link'); ?>" target="_blank" class="btn btn-plum btn-lg btn-event" role="button"><?php the_field('button_text');?></a>
      </div> 
      <div class="book-event-button" style="margin-top:20px;">
        <a href="<?php the_field('event_pack_upload'); ?>" target="_blank" class="btn btn-teal btn-lg btn-event" role="button"><?php the_field('event_pack_button_text');?></a>
      </div> 
      <div class="book-event-button" style="margin-top:20px;">
        <a href="<?php bloginfo( 'url' ); ?>/youth-community/support-us/events/tips-tools/" target="_blank" class="btn btn-plum btn-lg btn-event" role="button">TIPS AND TOOLS</a>
      </div> 
    </div>    



    <div class="col-md-9">
      <div class="page-header">
        <h1 itemprop="name"><?php the_title(); ?></h1>
        <p itemprop="description"><?php the_field('event_description'); ?></p>
      </div>      
    </div>      

  </div>

你可以看到我尝试使用itemtype和itemprop等添加标记...但我在google检查器中看到很多错误:https://search.google.com/structured-data/testing-tool

页面在这里:https://www.leicesterymca.co.uk/show/?showid=b74e95df-58f7-e611-80d7-00505601004c我确实想知道传播到两个DIV的信息是个问题......

非常感谢任何指导。

1 个答案:

答案 0 :(得分:0)

您必须在网站中修改许多内容才能实现架构指南。

我尝试使用适当的数据从您的网站为您提供演示。

<div class="container" itemscope itemtype="http://schema.org/TheaterEvent">   

 <div class="col-md-3">
     <div class="event-details">
        <h3>Event Info</h3>
        <strong>Date: </strong><p itemprop="startDate">Sun 21 May 2017 19:30</p>
        <strong>Time: </strong><p itemprop="duration">20:00</p>
    </div>
 </div>    

 <div class="col-md-9">
    <div class="page-header">
       <h1 itemprop="name">The Wild Swan World Tour</h1>
       <div itemprop="location" itemscope="" itemtype="http://schema.org/PerformingArtsTheater">
          <meta itemprop="name" content="Shakespeare's Globe"/>
          <meta itemprop="address" content="London, UK"/>
       </div>
       <p itemprop="description">Foy Vance knows how to write a song. It’s a naturally-born but dedicatedly-finessed skill that has led him to collaborate with artists as diverse as Plan B, Sheryl Crow and Rudimental, synced his music on multiple TV shows ranging from Grey’s Anatomy to the finale of Sons Of Anarchy, and caught the ears of some of the biggest players (in every sense) in music, from Elton John to Ed Sheeran.</p>
   </div>      
 </div>     

 <div itemprop="workPerformed" itemscope="" itemtype="http://schema.org/CreativeWork">
    <div itemprop="creator" itemscope="" itemtype="http://schema.org/Person">
        <meta itemprop="name" content="William Shakespeare"/>
    </div>
 </div>

</div>

请注意,当您尝试使用TheaterEvent显示架构时,必须要求使用名称和位置属性。

日期和时间的格式应为ISO 8601 date format

但是,在Schema Testing Tool中测试上面的代码时会有4个警告,但如果没有任何此类数据,则可以避免。

您可以在上面的TheaterEvent链接中使用demo查看更多内容。