Warning: count():

Hello there!!

I installed X , had a PHP error while updating the site via “theme options” and now suddenly have a warning:

Warning: count(): Parameter must be an array or an object that implements Countable in /home/.sites/922/site1614156/web/ferienhaus/wp-includes/post-template.php on line 284

The post-template.php line 284 writes:

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

Can anybody help me with this error?

Thank you very much!

Hello Rosa,

Would you mind trying to install and activate the child theme and see if it makes any difference?

https://theme.co/apex/child-themes

Let us know how it goes.

Thank you very much,

Unfortunately it doesn`t make any difference, the warning is still there.

Hello Rosa,

Please make sure that you are running PHP 7.2. And also make sure that you have meet the minimum requirements to run the latest WordPress which you can find it here: https://wordpress.org/about/requirements/

For the meantime, you can get rid of the PHP Warning notices by disabling the debug mode. You can do this by opening wp-config.php and adding


define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

When you revisit the page, you should no longer be seeing those PHP Warning notices.

Hope this helps.

Thank you for the code!

I have php 7.2,
but only MYSQL 5.5 -could this be the problem?

Thank you very much!

Edit: The code is already in the wp-config.php , so it does nothing :frowning:

Is there another option to hide this warning?

Hello Rosa,

Thanks for updating the thread. :slight_smile:

Can you please share WordPress and FTP login details in secure note for us to take a closer look?

Thanks.

Thanks you very much, here is the secure note!

Hi Rosa,

It should be okay now, I added these lines to wp-config.php

ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);

Cheers!

Oh, that`s great, thank you! :grinning:

You’re most welcome!
We’re glad we were able to help you out.

Thank you very much!!

I have another question: I entered the license code by mistake on the wrong website (I installed it on my private website just to test it but I wanted to build another website with the x theme)… I will delete x theme from my server next week. is it possible to get another license?

Hello Rosa,

Thanks for updating in! For every one license, you can validate two sites at a time. That would be great to validate your staging site and your production site. If you want to change another staging site, you can always revoke, reassign and validate the new staging site. To do that, please follow this steps

We would loved to know if this has work for you. Thank you.

1 Like

Thank you for your kind support!

I will try it next week!

You are most welcome!

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