司司司司司

Menu

解决Baidu Sitemap Generator无法生成XML的问题

Baidu Sitemap Generator 不支持PHP7.1以上版本

修改插件文件

一共需要修改两个文件的三个地方

文件1:/wp-content/plugins/baidu-sitemap-generator/baidu_sitemap.php

第22行找到

add_options_page("Baidu-Sitemap","Baidu-Sitemap",8,__FILE__,'baidu_sitemap_optionpage');

替换成

add_options_page("Baidu-Sitemap","Baidu-Sitemap",'manage_options',__FILE__,'baidu_sitemap_optionpage');

308行找到

list($today_year,$today_month,$today_day,$hour,$minute,$second)=split('([^0-9])',$blogtime);

替换成

list($today_year,$today_month,$today_day,$hour,$minute,$second)=preg_split('([^0-9])',$blogtime);

文件2:/wp-content/plugins/baidu-sitemap-generator/sitemap_function.php

439行找到

list($today_year,$today_month,$today_day,$hour,$minute,$second)=split('([^0-9])',$blogtime);

替换成

list($today_year,$today_month,$today_day,$hour,$minute,$second)=preg_split('([^0-9])',$blogtime);

覆盖原文件,再测试即可成功生成XML文件。

4141874512

来源:https://www.zhujidaba.com/1083.html

— 于 共写了843个字
— 文内使用到的标签:

Leave a Reply

Your email address will not be published. Required fields are marked *