WordPress.org

Ready to get started?Download WordPress

Forums

Error in Comment and Post Plugin (5 posts)

  1. myisha
    Member
    Posted 10 years ago #

    comment-word-count Plugin
    Warning: Invalid argument supplied for foreach() in /home/myisha4/public_html/blog/wp-content/plugins/comment
    -word-count.php on line 14
    line 14 is
    foreach ($words as $word) {
    most-commented Plugin
    Warning: Invalid argument supplied for foreach() in /home/myisha4/public_html/blog/wp-content/plugins/most-commented
    .php on line 19
    line 19 is
    foreach ($posts as $post) {
    recent-comments Plugin
    Warning: Invalid argument supplied for foreach() in /home/myisha4/public_html/blog/wp-content/plugins/recent-comments
    .php on line 18
    line 18 is
    foreach ($comments as $comments) {
    I got the Plugins at
    http://mtdewvirus.com/wp-hacks/
    is called
    Comment and Post Plugins
    My blog url is http://myisha.net/blog
    Thanks in advance
    Myisha

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

    They might be because there is nothing for them to work on.
    The '1' is a correct output, but the others have nothing to play with
    The plugins from MtDewVirus are fine - I've used them since WP 1.0.1

  3. Daynah
    Member
    Posted 10 years ago #

    It works now. :) It just needed a comment in the database... else it has nothing to report.

  4. myisha
    Member
    Posted 10 years ago #

    Thanks alot

  5. sjusc
    Member
    Posted 8 years ago #

    Just if anybody needs help with this, you can group the foreach function wtih:

    if(!empty($comments)) { }

    If you want, you can also incorporate this if there are no comments:

    if(empty($comments)) { echo 'No comments yet posted.'; }

    Hope that helps!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.