PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > CMS教程 > wordpress教程 > 正文

    wordpress发布文章时百度地图出错怎么解决

    作者:w634381967来源:网络浏览:时间:2020-09-30 00:07:50我要评论
    导读:最近遇到一个问题,在wordpress编辑文章发布的时候,百度地图插件Baidu Sitemap Generator会提示以下错误:Warning: Illegal string offs...
    最近遇到一个问题,在wordpress编辑文章发布的时候,百度地图插件Baidu Sitemap Generator会提示以下错误:

    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

    究其原因,是百度地图插件不能及时更新最新发布的文章导致的bug,以下是修复方法:

    1、打开 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的思路:每当发布文章时,sitemap都会自动更新.

    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-103-1313-1.html
    相关热词搜索: