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> ';
}}
?>