0

我已经就我的丰富网页摘要联系了谷歌,他们说某些 html 是隐藏的,这就是为什么丰富网页摘要在搜索引擎上还不可见的原因:

示例: URL:http ://www.theprinterdepo.com/hp-color-laser-4700dn-printer-q7493a-r 标记类型:产品、评论 隐藏内容:6

问题是,我在 magento、summary.phtml 中以这种方式实现了代码,但我看不到它是如何隐藏的。

<?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; ?>
4

1 回答 1

0

由于您没有引用您从谷歌获得的信息,我只能做一些一般性的说明:

谷歌似乎只注意到主要商业和社区网站上的 Schema.org 一致标记。否则,他们似乎并没有过多关注它。

您的代码有基本的语法错误,例如试图将div元素放入span元素中。(根据 validator.w3.org,该页面共有 110 个可报告的标记错误。)

PHP代码是无关紧要的。浏览器看不到它,搜索引擎也看不到它。

于 2012-10-15T18:05:44.793 回答