WordPress.org

Support

Support » How-To and Troubleshooting » Warning: Invalid argument supplied for foreach()

Warning: Invalid argument supplied for foreach()

  • I have recently reinstalled wordpress, after a devistating accident where I deleted the Database. I managed to restore the databse and reinstall wordpress.

    I am currently getting this error at the top of my index page:

    “Warning: Invalid argument supplied for foreach() in /home/****/public_html/wp/wp-blog-header.php on line 478”

    How would I go about removing this error, on lines 476-480 in wp-blog-header.php says this:
    [code]
    WHERE category_id = cat_ID AND post_id = ID AND post_id IN ($post_id_list)”);

    foreach ($dogs as $catt) {
    $category_cache[$catt->ID][] = $catt;
    }[/code]

    Aidan

Viewing 2 replies - 1 through 2 (of 2 total)
  • Have you got any empty categories?

    Yeah, I guess I do.

    How would I go about assigning them a catagory? When I go to the edit post in the admin panel, it comes up with an error that says:

    Well I cant actually get the error message right now because the server is down where my site is located. Though Error messages appear there as well, in the catagory section, as well as umm, in the create a new post section, where the catagory section would be in….

    I did restore my databse a little oddly, I had some how only had a txt file of just my posts and my comments, so I just restored those two tables….

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Warning: Invalid argument supplied for foreach()’ is closed to new replies.