Fix WordPress's Google Rich Web page Digest error

Source: Internet
Author: User
Tags modify php file wordpress blog

Recently in the use of Google Rich Web Page Digest test tool, found that for the default WordPress blog, there will always be three error messages appear, today I would like to introduce, how to modify the wordpress template file to repair these error information methods.

The error message content is:

warning:missing Required Field "Entry-title".

warning:missing Required Field "updated".

Warning:missing Required HCard "author".

The error message modification method for Entry-title is:

Open the single.php file, find a similar

The error message modification method for updated is:

Open single.php file and find <?php the_date ();? > A line, modify it to <div class= "date updated" ><?php the_time (' F S, Y ');?></div>

The error message modification method for author is:

Open the single.php file, locate <?php The_author (), and?> a row, modify it to <span class= "vcard Author" ><span class= "FN" ><? PHP the_author ();?></span></span>

In addition, in yesterday's "Google Rich Web page Summary tutorial", some readers want to give a version of WordPress template modified example, the following is a WordPress template example.

Open the single.php file and add the following code to the appropriate location:

<?php
$separator = ' › ';
$category = Get_the_category ();
if ($category) {
foreach ($category as $category) {
Echo ' <div itemscope itemtype= ' http://data-vocabulary.org/Breadcrumb ' style= ' display:inline ' > ';
Echo $separator. "<a href=\" ". Get_category_link ($category->term_id)." \ "Itemprop=\" url\ "><span itemprop=\" title\ "> $category->name</span></a>
";
Echo ' </div> ';
}}
?>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.