post-template的PHP7.2报错

今天面板查看日志文件,发现博客报错信息量好多啊~

仔细一看都是post-template报错内容

查询后发现原是跟php7.2兼容性问题

处理方案

将修改/wp-includes/post-template.php第284、285行内容

if ( $page > count( $pages ) ) // if the requested page doesn't exist
$page = count( $pages ); // give them the highest numbered page that DOES exist
 替换成
if ( is_array( $pages ) ) {
if ( $page > count( $pages ) ) // if the requested page doesn’t exist
$page = count( $pages ); // give them the highest numbered page that DOES exist
} else {
$page = 0;
}
崔哲博客本文短连接地址 : https://xn--xwr12q.xn--fiqs8s/q9v7N
点赞