WordPress.org

Ready to get started?Download WordPress

Forums

Problem with comments (3 posts)

  1. egeyisi
    Member
    Posted 9 years ago #

    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

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    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.

  3. egeyisi
    Member
    Posted 9 years ago #

    :-)
    Thank you, there was no comment. I posted one and it's OK. That was something which never came to my mind.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.