Invalid argument supplied for foreach()
-
Problem noted for the inanis-glass.1.1.01 theme:
Upon installation of WordPress 2.7, received the following error message at the bottom of the title page.
“Warning: Invalid argument supplied for foreach() in /…/content/wp-content/themes/inanis-glass/footer.php on line 215
line 215: foreach ($baby as $key => $value){
An array is implied, but not implemented. The following insert was developed by myself to correct the issue:
line 215: if ( !is_array($baby) )
line 216: return false;
line 217: foreach ($baby as $key => $value){
Note
backticks
inserted around code.Hope this is useful to others: I’ve noted more than 850 websites using the Inanis template also suffer from similar defects.
M.
- The topic ‘Invalid argument supplied for foreach()’ is closed to new replies.