Since 5.8, theme error foreach script-loader.php line 2652
-
WP v 5.8
PHP 7.4 (also tried 8.0, no diff)
Host 1&1
2 sites running WP since 2007, so experienced user here.Since 5.8 update, using a custom theme since 2007, I am seeing printed out on every page the following error message at the end of the page:
Warning: Invalid argument supplied for foreach() in xxxxxxxx/wp-includes/script-loader.php on line 2652
A google search shows MANY other users websites are showing same message relating to line 2652. And I have 2 sites, and both are affected.
Message is not present if I use a modern 2021 theme, so it is related to my custom theme somehow. That said, the theme is worked perfectly since 2007 and is very basic, so a WP change caused this problem.
Also, I notice that if I remove:
<?php wp_footer(); ?>from footer.php, the message goes away, but it seems as though that code SHOULD be present in all themes, so that is not a solution.
I have also experimented with tweaking the themes functions.php file, but even making that file empty does not solve the problem.
Help will be appreciated, thanks.
The topic ‘Since 5.8, theme error foreach script-loader.php line 2652’ is closed to new replies.