@rhand
Those warnings are for a foreach loop, my code didn’t include a foreach loop, so something else is causing the issue.
Can you switch to the default twenty-twentyone theme and add the code (probably index.php)
See if that works?
The code I supplied was tried and tested. So something else is causing your issue, especially a toggle.js issue as again, this isn’t linked to my code