image-gallery-for-cpt-or-post-in-wordpress icon indicating copy to clipboard operation
image-gallery-for-cpt-or-post-in-wordpress copied to clipboard

sizeof(): error in post template

Open avgustov opened this issue 2 years ago • 1 comments

Hello, there is an error in post page like sizeof(): Parameter must be an array or an object that implements Countable in /var/www/vhosts

i read that problem can be in php version, but i have tried many version and this is notsolve a problem

howcan i fix that bug?

php ver. 7.4 | wp ver. 6.1.1

avgustov avatar Feb 14 '23 16:02 avgustov

replace this line with the following..

before: $count = sizeof($url_array);

after: if ( empty($url_array) ) { $url_array = array(); } $count = count($url_array);

code-mtn avatar Jan 25 '24 20:01 code-mtn