如何解决BAIDU SITEMAP GENERATOR插件出现 ILLEGAL STRING OFFSET LC_IS_UPDATE_SITEMAP_WHEN_POST问题呢?当发布文章的时候,出现了这个,于是便有了下文。 ILLEGAL STRING OFFSET 这个错误请看鸟哥的《PHP5.4更新注意点》
wordpress网址地图插件现在用得比较多的就是柳城的《Baidu Sitemap Generator》,我现在用的也是这个!但是有时候会报一个这样的问题!在发布或更新文章,出现的 PHP Warning:Illegal string offset ‘ lc_is_update_sitemap_when_post ’ in ……/wp-content/plugins/baidu-sitemap-generator/baidu_sitemap.php on line 406, 出现这问题的解决办法是:
打开 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’);
}
直接把条件语句注释掉, 改为:
//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’);
//}
就行了。
修改后的代码大致意思是:每当发布文章时,sitemap都会自动更新。
JA5A 正则表达式陈广佳版本(超详细)
Linux Lite 6.4今日发布基于 Ubuntu 22.04.2 LTS/原生应用支持 Zstd 压缩
0.1秒的价值!浅谈Web前端页面提速问题实用指南
Linux 6.3发布第4个候选版本 diffstat占比超过50%
linux无法识别ntfs格式U盘怎么办? 解决linux不识别nfst格式u盘问题技巧
Linux Mint 21.2 将于 6 月发布 主要改进了登录屏幕