我刚刚联系了谷歌,询问为什么丰富的片段没有显示在他们的结果中,他们回答了以下问题
URL: http://www.theprinterdepo.com/hp-color-laser-4700dn-printer-q7493a-r
Markup Type: Product, Reviews
Hidden content: <span itemprop="reviewCount">6</span>
我检查了 IE 开发工具,确实它是隐藏的,但它没有隐藏在我的 html 中,知道我做错了什么吗?
<?php if ($this->getReviewsCount()): ?>
<div class="ratings">
<?php if ($this->getRatingSummary()):?>
<span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<div class="rating-box">
<div class="rating" style="width:<?php echo $this->getRatingSummary() ?>%"><meta itemprop="ratingValue" content="<?php echo $this->getRatingSummary()/10 ?>"/></div>
<span itemprop="reviewCount"><?php echo $this->getReviewsCount() ?></span>
</div>
</span>
<?php endif;?>
<p class="rating-links">
<a href="<?php echo $this->getReviewsUrl() ?>"><?php echo $this->__('%d Review(s)', $this->getReviewsCount()) ?></a>
<!--<span class="separator">|</span>-->
<!--<a href="<?php echo $this->getReviewsUrl() ?>#review-form"><?php echo $this->__('Add Your Review') ?></a>-->
</p>
</div>
<?php elseif ($this->getDisplayIfEmpty()): ?>
<p class="no-rating"><a href="<?php echo $this->getReviewsUrl() ?>#review-form"><?php echo $this->__('Be the first to review this product') ?></a></p>
<?php endif; ?>