最近遇到一個(gè)問(wèn)題,在wordpress編輯文章發(fā)布的時(shí)候,百度地圖插件Baidu Sitemap Generator會(huì)提示以下錯(cuò)誤:
Warning: Illegal string offset 'lc_is_update_sitemap_when_post' in /home/cdkxcn/public_html/wp-content/plugins/baidu-sitemap-generator/baidu_sitemap.php on line 406
究其原因,是百度地圖插件不能及時(shí)更新最新發(fā)布的文章導(dǎo)致的bug,以下是修復(fù)方法:
1、打開(kāi) baidu-sitemap.php 文件并找到 第 406 行的以下代碼:
if($get_baidu_sitemap_options[' lc_is_update_sitemap_when_post '] == ’1′){
wp_clear_scheduled_hook(‘do_baidu_sitemap_by_post’);
wp_clear_scheduled_hook(‘do_this_auto_daily’);
wp_schedule_single_event(time()+10, ‘do_baidu_sitemap_by_post’);
}
2、把這段代碼注釋掉,注釋后的代碼如下:
//if($get_baidu_sitemap_options[' lc_is_update_sitemap_when_post '] == ’1′){
wp_clear_scheduled_hook(‘do_baidu_sitemap_by_post’);
wp_clear_scheduled_hook(‘do_this_auto_daily’);
wp_schedule_single_event(time()+10, ‘do_baidu_sitemap_by_post’);
//}
3、修改bug的思路:每當(dāng)發(fā)布文章時(shí),sitemap都會(huì)自動(dòng)更新.
新聞熱點(diǎn)
疑難解答
圖片精選