Warning: count(): Parameter must be an array or an object that implements Countable in

dear support!

i receive this warning when i start cornerstone to edit a page in x:

Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/8/d76540354/htdocs/annapaulus.de/wp-includes/post-template.php on line 284

and line 284 reads

if ( $page > count( $pages ) ) // if the requested page doesn’t exist

in the wp-confiq.php the setting for debug is

define(‘WP_DEBUG’, false);

thanks for your help! kai

1 Like

Hi Kai,

Thanks for writing in! What’s the PHP version that you’re running on your site ? We recommend to use PHP v5.6.x or later to avoid incompatibility issues. Also if you’re using the latest PHP version such as v7.2.x, try switching to earlier version such as v7.1.x.

In the meantime, you can also add the following code into your wp-config.php file by replacing the line you already have define('WP_DEBUG', false);.

define( 'WP_DEBUG', true ); 
if ( WP_DEBUG ) {
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );
}

This will create an error log file under your wp-content directory, with the name of debug.log and also it will not display any errors for your visitors.

Thanks!

1 Like

hi darshana!
thanks a lot for your help!
i was von php 7.1 now on 7.2. that did not help.
i included your code in the wp-confiq.php. that also did not get rid of the message. i now have even on top of that a red window showing:

Uh oh!
No suitable preview area found. This could happen when a third party plugin is overrinding the content area.

also. just suppressing the message does not get rid of the problem. right?
hope you have more ideas :wink: thank so much! kai

Hi Kai,

Are using the latest version of WordPress core? If you’re using an older version, please follow this guide and update WordPress.

Also check to see if you’re using the latest version of X/Pro theme and it’s compatible plugins (https://theme.co/apex/forum/t/troubleshooting-version-compatibility/195). If you’re using any older versions, please update any outdated theme or plugins by following our guide here (https://theme.co/apex/forum/t/setup-updating-your-themes-and-plugins/62).

To see if your Cornerstone plugin has any corrupted or missing files, you can delete the current version of your Cornerstone plugin through WordPress plugins section. Then head over to X -> Validation section and wait for few seconds to install the latest version automatically.

Also you will need to disable your 3rd party plugins and test this issue further.

Let us know how it goes.
Thanks!

dear Darshana,
thanks for your fast reply!
everything is up to date on my site.
i deleted cornerstone. and it reinstalled itself automatically!
but the error persists :frowning:
i do not use any funny 3rd party plugins and only plugins i keep using on other sites, too.
how would i deactivate all of them? rename the plugin folder via ftp?
thanks again! kai

Hello @iTurtle,

Thanks for updating the thread.

You can deactivate plugins from Plugins > Installed Plugins. Here’s a screencast that you can take a look to deactivate plugins.

To learn more you can take a look at following tutorial:

https://www.a2hosting.in/kb/installable-applications/optimization-and-configuration/wordpress2/wordpress-plugins/disabling-plugins-in-wordpress

In case problem is still there, please share website login details in secure note for us to take a closer look.

Thanks.

I am also receiving the same error message. I followed your instructions in deactivating the plug-ins, deleting Cornerstone and reinstalling yet the problem still persists. Should I open up a separate ticket. The website in question is https://clarabellsoncooper.com

Hi @FasteddieB,

I’ve deleted your admin credentials as the author of this ticket can see it as well.

I will follow your separate ticket.

Regards!

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