I recently made a local copy of an existing site to make development changes. Most everything is working fine in the local version, except that at the top of any Page I see this error (sometimes more than once) –
Warning: count(): Parameter must be an array or an object that implements Countable in /[website directory]/wp-includes/post-template.php on line 284
It looks like
<?php wp_head(); ?> is throwing the error when php checks to see if the selected post has more than one page, and that it's the
$pages variable that's failing. I've tried manually setting
$pages to an empty array before that, but that didn't make any difference.
The only other thing I can think of is that my dev environment is running php 7.2 but the production server (which is working fine) is running 5.6. Might that have anything to do with this issue?