• Started Getting the following error where the content boxes are supposed to appear on the homepage:

    Warning
    : count(): Parameter must be an array or an object that implements Countable in
    …/wp-content/themes/evolve/functions.php
    on line 244

    The same Error appears 4 times as I have 4 content boxes on the homepage

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • This is a PHP version related issue and will be fixed in the next theme version soon. Thanks for patience

    Thread Starter ginmi

    (@ginmi)

    Thanks for your prompt reply @romik84.

    When is the next version due to be released? I’d like to know that as my homepage is currently broken!

    I am currently on PHP 7.2. will downgrading to 7.1 or 7 provide a temporary fix?

    Also, I’ve had version 3.9.4 of the theme running on my site for 3 weeks now and haven’t had this problem till now. How come?

    I haven’t changed PHP versions during this time

    in evolve/functions.php replace line #243:

    if ( $result ) {

    with

    if ( $result && ! empty( $result ) && $result != '' ) {

    and line #250:

    count( $result ) != 0
    && ! ( strpos( $result, 'fas ' ) === 0 )

    with

    ! ( strpos( $result, 'fas ' ) === 0 )

    Romik, when I go to edit functions.php — the line numbers are different than you specified.

    237 if ( $result ) {

    and

    244 count( $result ) != 0
     && ! ( strpos( $result, 'fas ' ) === 0 )

    I also see the PHP error reported as being line 244. (I get the error message in logs but it doesn’t impact site function — but I’m going to try the change above at the line numbers I’ve indicated.

    `

    @abigailm line numbers might change as I did several changes to the file since that change. That’s why I wrote the code which need to be changed ??

    Thread Starter ginmi

    (@ginmi)

    You need to enable content boxes on the homepage @abigailm and also make sure your website is running on PHP 7.2 in order to get the error

    Really curious if you get the same issue so looking forward to your update.

    Until @romik84 releases a fix, I decided to simply downgrade to PHP 7.1 and the issue is now gone.

    I thought it’s better to wait for the new version instead of playing manually with the theme code (which will be overwritten anyways when the new update is released).

    Be nice if you could release a fix sooner rather than later @romik84 as I prefer to run my site on the latest stable PHP version as it has certain benefits over 7.1 when it comes to load speed.

    @ginmi – I do have content boxes & running PHP 7.2 — and actually this error was reported weeks ago. But it’s a PHP warning, not a fatal error.

    If you don’t want warnings to display on your site or disrupt function, then you need to correct your wordpress configuration to disable display — see https://www.wpbeginner.com/wp-tutorials/how-to-turn-off-php-errors-in-wordpress/ for instructions on how to do that.

    The correction that Romik supplied for functions.php won’t be overridden because he’s fixed it for future versions — his instructions above are just describing the fix that’s in his development code. So it’s an advance look for those of us who don’t want to wait.

    He’s probably got other issues he is also working on before releasing the next update.

    @abigailm yes, working on speed improvements ?? and other bugs ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Error in content boxes’ is closed to new replies.