Some stupid problems with wordpress theme

i habe updated today my wordpress installation.

And everything works fine, but only the catecory pages.

Read More

Get errot tha in the index.php of my theme file, invalid argument foreach.

$jsFiles = glob('*.js');

foreach($jsFiles as $jsFile)....

so he cant find the js files… or what? All other pages works fine – tags, pages, posts… i cant explain it 🙁

Related posts

Leave a Reply

2 comments

  1. It means that what you supplied to the foreach construct is not an array. You can do something like this to see if the value is an array before you try to foreach over it:

    if (is_array($jsFiles)) {
        foreach($jsFiles as $jsFiles) // ....
    } else {
        // $jsFiles is not an array
    }