SmartStart WordPress Theme Fix

January 31, 2013 2 min read

This is an oddly-specific post that I’m leaving here just in case my blog can better focus on the issue than ThemeForest’s flat comments1.

A rather common problem with the SmartStart Responsive HTML5 WordPress theme is that upon upgrading to WordPress 3.5, the site will suddenly start throwing an error on portfolio pages:

Warning: array_count_values() [function.array-count-values]: Can only count STRING and INTEGER values! in (...)/themes/smartstart/functions/custom-functions.php on line 640

A quick fix that drops the error and seems to leave everything in good order is to wipe out a line that tries to count something that’s not there. You can do this by opening smartstart/functions/custom-functions.php in a text editor (it’s okay if PHP seems scary) and finding line 640. You’re looking for this part:

$slide_types = array_count_values( $project_slider[0][0] );

And you’ll want to change it to look like this…

//$slide_types = array_count_values( $project_slider[0][0] );
$slide_types = 0;

Don’t forget to save your file! By adding two forward slashes in front of the original line you’re just commenting it out and telling WordPress to ignore it, so if you have any problems you can easily undo your change.


  1. Flat comments seem pretty lame since the discussion areas often act like support forums, and many helpful bug reports and solutions get buried.

***

Tagged

Updated 6/16/19 at 7:58pm