• Hi, I don’t know why but when I add the second post on the blog this message error shows up in the categories sections:
    Categories:
    Warning: Invalid argument supplied for foreach() in c:\programmi\easyphp\www\wp-includes\template-functions-category.php on line 340
    * No categories
    I didnt delete the first post :”Hello world!”
    I leave the blog with this warning hoping that someone answers me asap./Dario
    I forgot to write the address: http://dariete.rr.nu

Viewing 7 replies - 1 through 7 (of 7 total)
  • I am not 100% sure but try adding a category in the user interface (even if it is just “General”) . Then try rewritting your post and asign it to the new Category you just created.

    Thread Starter solemare

    (@solemare)

    I did already that but still not working. Others suggestions?

    I the problem is solved @ http://dariete.rr.nu/ , but I confirm that the error is indeed caused by not having at least 1 successful post properly linked to in all the proper tables (wp_posts, wp_post2cat, wp_categories). The foreach @ wp-includes\template-functions-category.php on line 340 requires that at least 1 post be in associated with any category.

    Uh, so how do you fix it??

    I had the same problem but I managed to fix it. The problem was that there wasn’t any posts in any categories. Put a post in some category and it’s fixed. It seems that wordpress requires at least one post in some category or this error occurs.

    I have a post in each catergory, but still get the same error message. Here is the line referenced:

    foreach ($categories as $category) {

    *argh*
    This is my first time using php and mysql [imagine my shock when i got this blog up relatively quickly] and i am having an error across the top of my page: “Warning: Invalid argument supplied for foreach() in /wp-admin/templates.php on line 96”
    In the “Manage:Files” section i have this list:
    “Common
    Main Template
    .htaccess (for rewrite rules)
    my-hacks.php (legacy hacks support) “

    This was my first install of wordpress and no plugins are activated. I tried addinga post to see if the ‘no posts in blog’ problem that i’d read of here was the prob, but that didn’t work … and advice? Thank you for your time
    -daniel

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