! This article may No update for more than 2 years In the future, the content may not be maintained or supported. Some of the content may be timely, involving technical details or software use. This article does not guarantee the corresponding technical updates and practical operability.
This seems to be a problem left over from history. I remember that similar problems were found before, but it seems that there is no good record, so I just write a solution today
background
The story happened last night when Facebook submitted a sharing link. It was incredible at that time. But if it did happen, we had to deal with it. Otherwise, obsessive-compulsive disorder would be very unpleasant
Environmental Science
system WordPress 5.1.1
theme kratos-pjax-0.3.9
- [Github Project]
Warning content
As shown in the figure, after all, no other location was found!
![Warning content](https://7niu.cuizhe.me/typecho/2019/03/1132116916.png)
Warning:count():Parameter must be an array or an object that implements Countable in /****/wp-includes/post-template.php on line 293
The viewing code is as follows:
if ( $page > count( $pages ) ) { // if the requested page doesn't exist
Treatment scheme
Search if you know the problem. After all, you are not a god. Google has found similar problems- [Similar problem transmission matrix]
It seems that it has something to do with the PHP version. No matter what, first solve the problem. The content given by friends on the # 40th floor is of great reference value
Modify the original code as follows
if ( $pages && $page > count( $pages ) ) { // if the requested page doesn't exist
Verification scheme
![Verification scheme](https://7niu.cuizhe.me/typecho/2019/03/971475601.png)
This should solve the problem temporarily. I haven't found any other problems yet
Extended Links
Warning with PHP 7.2 - Transport array
First creation time: 12:31:00, March 19, 2019
Last modification time: 2020-08-19 21:56:21