錯誤訊息 Missing required field "updated" 解決方式

Subtitle

作者: 七味粉 |
文章2013-06-15
94 分享
22
如果你是使用 WordPress 的 TwentyTen 佈景主題來架設網站的話,在使用 Google 結構化資料測試工具你應該會出現 Missing required field "updated" 的錯誤。
修改方式如下:

將 <span class="entry-date">; 改成 <span class="date updated";>


function twentyten_posted_on() {
printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ),
'meta-prep meta-prep-author',
sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="date updated">%3$s</span></a>',
get_permalink(),
esc_attr( get_the_time() ),
get_the_date()
),
sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
get_author_posts_url( get_the_author_meta( 'ID' ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'twentyten' ), get_the_author() ) ),
get_the_author()
)
);
}

▲修改 functions.php 這個檔案。
馬上前往:結構化資料測試工具   
貼心小提醒
1.您目前未登入,若於此狀態進行文章收藏,紀錄可能無法長期保留。
2.建議登入後進行收藏,好文會幫你保存著,隨時要看也不怕找不到唷~

KiKiNote持續為您提供最優質的資訊內容,謝謝您!
不再顯示此視窗

複製成功