WordPress.org

Support

Support » Plugins and Hacks » Problem with comments

Problem with comments

  • I’ve been used WordPress for two of my websites and I had no problem with displaying the “last n comments” and the “most commented” on the main page. However for my third site with WordPress, a problem which I can’t understand occurs in that case. When I put the script to “my-hacks.php” and call the hack from the main page, it gives the following message:
    ” Warning: Invalid argument supplied for foreach() in c:\apache\htdocs\yverkac\my-hacks.php on line 59 “
    According to this message I checked the line 59, but there seems to be no problem. Here is the line 59:
    ” foreach ($posts as $post) “
    Now, do you have any idea why it gives this message instead of showing the most recent comments or the last n comments (the same error occurs for each of these hacks.)
    Thank you for your help.
    Erhun

Viewing 2 replies - 1 through 2 (of 2 total)
  • On your new site, how many comments / posts are present ?
    I had this too, so I dropped the hack/plugin, waited until I had a couple more posts and comments and then it worked fine. Don’t know why it didn’t before though.

    🙂
    Thank you, there was no comment. I posted one and it’s OK. That was something which never came to my mind.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with comments’ is closed to new replies.
Skip to toolbar