WordPress.org

Ready to get started?Download WordPress

Forums

Receiving an Invalid Argument Error on homepage (15 posts)

  1. liztardostroebel
    Member
    Posted 2 years ago #

    Hello-
    I am new to this and was wondering if someone could help me understand why I am getting an error on my homepage and if this has to do with my hosting (which I did not set up , and I may actually have screwed up). Here is the error string:

    Warning: Invalid argument supplied for foreach() in /home/liztardo/public_html/home/wp-includes/class-wp-admin-bar.php on line 342

    Thank you in advance!!

    Eileen

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

  3. vintagecrafts
    Member
    Posted 2 years ago #

    Hi,

    After updating to 3.3, I'm getting the same warning across the top of my blog:

    Warning: Invalid argument supplied for foreach() in /home/viola1/public_html/vintagecraftsandmore.com/wp-includes/class-wp-admin-bar.php on line 342

    I read the trouble shooting solutions and deactivated all my plug-ins, but it's still there. I also deleted all of the inactive plug-ins.

    Not sure what to do now. I can get to the PHPMyAdmin in my cPanel, but don't know what to do or look for after that.

    Thanks!

    Debra

  4. vintagecrafts
    Member
    Posted 2 years ago #

    Okay, I tried the Twenty Eleven theme and the Warning went away. I was using the Liquorice Theme 2.2 by Nudge Design. If I'd like to continue to use this theme, do I wait until there is a fix or contact the creator for a fix or just change themes?

    Thanks!
    Debra

  5. liztardostroebel
    Member
    Posted 2 years ago #

    I don't want to use the Twenty Eleven theme either!! I need to use the theme that I'm currently using (Allure with the Placester plugin). Ahh. I hope someone else can help.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    The steps suggested are part of the basic troubleshooting process.

  7. vintagecrafts
    Member
    Posted 2 years ago #

    Going through the troubleshooting process - it's the theme so should I...

    1) Wait for it to be fixed with WP 3.3.1

    2) Contact the theme developer for a fix

    3) Continue to use the theme with the error

    4) Change themes

    5) Venture into my PHPMyAdmin and hope for the best!

    liztardostroebel, were you able to find a fix yet?

    Debra

  8. liztardostroebel
    Member
    Posted 2 years ago #

    Hi Debra,

    I was also told it's my theme. I contacted the theme developer and told them to look into it, but in the mean time I am looking for a new theme.

  9. vintagecrafts
    Member
    Posted 2 years ago #

    I haven't contacted the developer for my theme yet. I guess I'll try that next, because I really don't want to change themes. I've looked at a couple and can't find anything close to the designs like the one I'm using.

    I'm doing a new post today and if everything goes okay, I might just sit it out for awhile with the error. Only I can see it, I hope. I'm going to ask someone on another computer to check out my site after I do the post and see how it looks.

    Fingers crossed!

  10. Stepasyuk
    Member
    Posted 2 years ago #

    I have such problem in the old theme developed few years ago. In my case the problem was in footer.php - the function <?php wp_footer(); ?> called there two times ( First wp_footer(); second do_action('wp_footer'); )

    The message

    Warning: Invalid argument supplied for foreach() in /home/liztardo/public_html/home/wp-includes/class-wp-admin-bar.php on line 342

    appears if the code:

    foreach ( $root->children as $group ) {
    	$this->_render_group( $group );
    }

    is called several times.

  11. Sergey Biryukov
    Trac Moderator
    Posted 2 years ago #

    This warning indeed appears if a theme has two wp_footer() calls in footer.php, or both do_action('wp_footer') and wp_footer().

    There should be only one call, right before </body>.

  12. Ateo
    Member
    Posted 2 years ago #

    Thanks! My theme had 2 instances of wp_footer(). Problem solved.

  13. pxmedia
    Member
    Posted 2 years ago #

    Same here, I had this under the </html>
    <?php do_action('wp_footer'); ?>
    Another with more code above. I removed the <?php do_action('wp_footer'); ?> and all is now working. This appeared after the upgrade to WP 3.3.

    Thanks,
    DG,

  14. q292u
    Member
    Posted 2 years ago #

    Same problem. "Elements of SEO" theme.
    I had a do_action and a wp_footer call in the footer.php file.
    Removed one and it's fine now.
    Not sure if I originally added one or the other call, or whether it's like that as it comes. Either way, remove one or the other and it's sorted.

    Supercars-for-sale.com

  15. vintagecrafts
    Member
    Posted 2 years ago #

    It worked! I removed the second '<?php wp_footer(); ?>' in the footer.php and left the one right before /body and the error is gone.

    Appreciate the help. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic