casedimage
Member
Posted 1 year ago #
Hi, hope this is not a duplicate thread but I'm not having exactly the problem that most are having with upgrades.
After upgrading to 3.3, I can see and use my admin/dashboard page fine but when I go to the site after logging in to the admin page, don't have the admin toolbar like I used too. Instead I get this ;
Warning: Invalid argument supplied for foreach() in /[abridged address]/wp-includes/class-wp-admin-bar.php on line 342
Any thoughts?
thanks
probably a theme problem, try changing theme and see if it works with the deafualt one for example. that should point you in the right direcion.
Jason Kemp
Member
Posted 1 year ago #
I got an error that starts
Fatal error: Call to undefined method Custom_Admin_Bar::add_group() [name of site here] wp-includes/admin-bar.php on line 169
Anyway I switched themes and it is a theme issue which I will have to have a look at
@casedimage have tried switching theme to default theme
casedimage
Member
Posted 1 year ago #
Yes when I change themes the toolbar comes back. The design of the rest of my website (casedimage.com) is based around this theme - Wooden Mannequin 1.1.
I did find this article -
http://voodoopress.com/wordpress-3-1-admin-bar-upgrade-issues/
The header/footer solutions didn't work which is not surprising given the error is in the class-wp-admin-bar.php. But it did give me a solution - to remove the admin toolbar when viewing the site, through editing my options on my user profile. I never used the toolbar from the site anyway but it was handy to see the stats there. Them's the breaks!
Thanks all for your help.
Tagged the post for the theme, but it's not been updated in years, so you may be out of luck there :(
xdementia
Member
Posted 1 year ago #
I'm having this issue as well. What theme are you guys using? I'm using a modification of Arthemia.
As stated, they're using Wooden Mannequin.
Try switching to an UN modified version of your theme and see if it's your changes. If not, please make a NEW topic for yourself so we can track down theme issues there. :)
lonestarseo
Member
Posted 1 year ago #
Removing "<?php wp_footer(); ?>" from footer.php of your custom template will remove the Line 342 error and show the admin bar; however, it may prove problematic for anything that requires "<?php wp_footer(); ?>" to function properly.
I'm having issues on a bunch of my wordpress sites.
Fatal error: Call to undefined method Custom_Admin_Bar::add_group() in /home/content/07/4012107/html/wp-includes/admin-bar.php on line 169
Is showing up in the footer on all sites after the upgrades.
TakeTheCann0lis
Member
Posted 1 year ago #
Same issue. I'm not seeing any errors though. I've also tried switching to TwentyTen and TwentyEleven with no success. I do see a space at the top where it should be, but not bar.
lonestarseo: interesting ... My site (happythursday.com) is using a slightly modified Wooden Mannequin v1.1 theme running on WP3.3 and I've not had an issue with errors or a missing Admin bar. My theme still retains the original PHP in footer.php. It reads somewhat different from what you post, though. Mine is:
<?php do_action('wp_footer'); ?>
Having same issue as TakeTheCannOlis. No errors. No success when switching themes. No toolbar.
TakeTheCann0lis
Member
Posted 1 year ago #
After tinkering for a little bit, I realized that WP Super Cache was causing the issue with Twenty-10 and Twenty-11. I disabled the plugin but still had problems with the other themes that I've used. WP Anniversary is my standard theme. I posted on their forum.
xdementia
Member
Posted 1 year ago #
So, is there an actual resolution to this issue other than removing the footer of our theme?
TakeTheCann0lis
Member
Posted 1 year ago #
Update... I added <?php wp_footer() ?> to the very end of my footer right before the closing body tag and now I have my toolbar back.
Try it out
Your theme can call mytheme_footer, which is not the same as the default and generally required wp_footer. Each just add items just above the closing body tag.
Mr.vAhiD.DI
Member
Posted 1 year ago #
Hi everybody;
Do this works to solve this problem:
put this footer code:
<?php wp_footer(); ?>
before:
</body>
</html>
& put this code:
<?php wp_head(); ?>
before
</head>
best wishes,
Mr.vAhiD.DI
vincentabry
Member
Posted 1 year ago #
I have the same error message than @dialogcrm and when I switch theme it works perfectly.
None of the solutions above works so I would like to know if someone knows the thing to fix in the theme ?
in functions.php?
thank you.
I wouldn't consider this resolved. Many people seem to be having this issue. I run a dozen wordpress sites and this is happening on nearly all of them.
My temporary fix has been to strike/comment out the lines referring to the add_group() function. While this brings in the bar and stops the error from blocking other functions, the admin bar is now messed up and non-functional.
Help. Please.
Fatal error: Call to undefined method Custom_Admin_Bar::add_group() [name of site here] wp-includes/admin-bar.php on line 169
This error means some plugin or your theme is replacing the standard Admin_Bar class with some Custom_Admin_Bar one which is missing the add_group() method.
For example, this code snippet would cause exactly the same error:
http://pastebin.com/H2PuzzE3
In WordPress.org directory, I have not found any plugins or themes doing this.
If disabling plugins didn't help, I'd suggest searching for wp_admin_bar_class string in your theme files.
@Sergey
Thank you very much. Your comment gave me the hint I needed.
I found the Custom_Admin_Bar class in my theme's classes.php file and commented it out. Then I removed the comments I had put on the includes/admin-bar.php, returning the add_group function. Works perfectly now.
Thanks for the hint, it gave me just the right information I needed to find the solution!
vincentabry
Member
Posted 1 year ago #
@sergey @gosbdc : you are my heroes !!! it works!!!! I knew it was my theme but didn't know where to fix it.
I just deleted the custom_admin_bar php code from classes.php and it works. I think I could completlty delete this file but it's called from functions.
So Happy Christmas Guys and a Big Thank You !!