Count(): Parameter must be an array or an object that implements Countable

Hi there,

I’m Seeing this on any Portfolio item that doesnt have content in.

Warning: count(): Parameter must be an array or an object that implements Countable in /home/skyvisua/public_html/chainlinkecosystem.com/wp-includes/post-template.php on line 317

I’ve tried all of the solutions currently on the forum, please could you look into this ASAP?

Hello Samuel,

I tried to replicate this on my local setup but I am not getting the any warning message even when my portfolio content is empty.

Also, please note that what you are seeing is just a warning message and not an error message and this is showing up because you debug function is enabled. Having the debug function enabled is helpful when your site is in development or if you are trying to trace an error.

Is it possible to have it disable by when you login through FTP then edit the wp-config.php file and find the line: define( 'WP_DEBUG', true );. Set it to false then save the file.

You may also try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Let us know how it goes.

Hi,

I just checked the wp-config.php file, and the WP_DEBUG is already set to FALSE.

So why are the messages still appearing?

Is there any other way to turn them off?

Thanks.

Hello Samuel,

Perhaps it is being override by your host.

Please try adding these lines as well:

ini_set('log_errors','On');
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

In case you are still seeing the warning messages, kindly get in touch with your web host and ask them to disable it.

Thank you.

I’ve just deactivated the only third party plugins I’m using and the problem still exists.

These are the only plugins currently activated:

Classic Editor (by WordPress)
Google Analytics (by Themeco)
The Grid (by Themeco)
Loginizer (very popular brute force plugin - doubt this would cause the issue)
SG Optimizer (Sitegrounds optimization plugin)

Jade, it worked! Thank you so much - this has been causing me much anxiety over the past 24 hours.

No worries at all. Glad to hear it’s sorted, Samuel. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.