关于 升级wordpress4.0后 Baidu Sitemap Generator 发布文章时报错解决办法

2014年9月9日

关于 升级wordpress4.0后 Baidu Sitemap Generator 发布文章时报错!,报错内容如下:
Warning: Illegal string offset ‘lc_is_update_sitemap_when_post’ in ****/wp-content/plugins/baidu-sitemap-generator/baidu_sitemap.php on line 406

Warning: Cannot modify header information – headers already sent by (output started at ****t/plugins/baidu-sitemap-generator/baidu_sitemap.php:406) in /****/wp-admin/post.php on line 233

Warning: Cannot modify header information – headers already sent by (output started at /****l/wp-content/plugins/baidu-sitemap-generator/baidu_sitemap.php:406) in ****/wp-includes/pluggable.php on line 1173

看来是baidu_sitemap.php 文件里的406行代码有问题!

1、打开 baidu-sitemap.php 文件并找到 第 406 行的以下代码:

  1. if($get_baidu_sitemap_options[‘ lc_is_update_sitemap_when_post ‘] == ’1′){
  2. wp_clear_scheduled_hook(‘do_baidu_sitemap_by_post’);
  3. wp_clear_scheduled_hook(‘do_this_auto_daily’);
  4. wp_schedule_single_event(time()+10, ‘do_baidu_sitemap_by_post’);
  5. }

2、把这段代码注释掉,注释后的代码如下:

  1. //if($get_baidu_sitemap_options[‘ lc_is_update_sitemap_when_post ‘] == ’1′){
  2. wp_clear_scheduled_hook(‘do_baidu_sitemap_by_post’);
  3. wp_clear_scheduled_hook(‘do_this_auto_daily’);
  4. wp_schedule_single_event(time()+10, ‘do_baidu_sitemap_by_post’);
  5. //} 

3、修改bug的思路:每当发布文章时,sitemap都会自动更新。

 


值得买可告诉更多想省钱朋友
查询最新优惠券可加微信号:jlzy696
省钱网快报:大家都在抢什么?点此查看>>>
省钱快报,发现更多值得买的优惠券商品
加微信

实得惠省钱网,是致力于帮助网友们获知优惠信息平台,每天提供实惠值得买的网购优惠券特价资讯。如您发现了优惠券失效,或无法领取淘宝优惠券,点此查询最新优惠券。优惠信息有时效性和地域性,还请各位网友购买时注意核实。更多优惠促销信息可加【159192980】Q群(查优惠券)或者点这里查券可扫码(也可加微信号):jlzy696

已有 0 条评论
收藏0
省钱快报网
回到顶部