WordPress 2.5 Widgets Bug
If you’re known to use widgets, you may want to keep your eyes open for a small bug which I’ve come across on this blog while trying to update my newest theme.
This quirk is hard to describe, but I’ll do my best…
First, the theme I’m working on features 3 sidebars: One with a custom name, Top Side, and two using the ‘Sidebar %d’ method (i.e. Top Side, Sidebar 1 and Sidebar 2).
I created a custom text block for the first widget and added it to ‘Top Side’. So far, so good. Tweaked the functions.php file in order to remove the before and after widget <li> code and all continued to be right with the world.
Then, I decided to add a widget to the first sidebar and that’s when the sky fell down on my head.
All the widgets disappeared from view in both ‘Top Side’ and ‘Sidebar 1′, although the widgets are still registering as active in WordPress. I was able to remove the original text widget by adding the pages widget to ‘Top Side’, but I’m still unable to remove or update Sidebar 1 — not even when I add another widget to it. See the screen shot.
You’ll note that although it says there is 1 active widget in Sidebar 1, there aren’t actually any widgets shown which means I can’t edit or delete it from the sidebar.
Now, for ‘Top Side’, I’m shown the page widget, but when I remove it, I’m told there are -1 widgets. How exactly is it possible to have less than zero widgets?
As a result, saving the changes means that the pages widget still shows up under Top Side and there’s no way to get rid of it or assign it to a different sidebar.
Looks like I’ll have to unbork this from phpMyAdmin. But, just a head’s up if you’re planning to widgets, do so with caution. There may be a bug lurking for those themes which use more than one sidebar.
UPDATE: Playing around with the theme a bit more, it appears that for some reason, Top Side seems to be stealing all the widgets, although they seem to be properly assigned in WordPress and display accordingly on the site. This will probably be more of a headache for theme authors and some unsuspecting users who don’t understand why they add a widget to Sidebar 2, but all of their widgets are appearing under Sidebar 1.
Look closely at the screen shot above. Although it says there are 0 widgets in ‘Top Side’, there are clearly 3 widgets (which I actually assigned to Sidebar 1) showing up.
The solution, in case you care to know, is to manually register all of your sidebars individually, even if a couple of them will be using the same format. (i.e. no mixing of register_sidebar() with register_sidebars()).



March 31st, 2008 at 5:23 pm
You’re not the only one that has had some little quirks since updating. I havent had the chance to begin/code my site since I switched from movable type but in using the k2 theme – after updating both it and wordpress the site would load every other time correctly. Very strange . Refresh – there it is, next time you refresh, nada.
March 31st, 2008 at 7:21 pm
Actually, it’s a bummer and it probably should have been mentioned somewhere seeing as how K2 is so popular, but due to many of its customizations, it’s actually not compatible with WordPress 2.5 yet.
So, if you want your blog to work properly, switch to a different theme until K2 gets it WP 2.5 upgrade. Sorry to be the bearer of bad news. :/
~ Teli
April 4th, 2008 at 4:12 am
I don’t think its just a theme issue. I’m building my site with the sandbox theme which has been updated for wordpress 2.5 and I loose both bars when I add widgets. This isn’t the only theme I have thats doing this. This is most likely a bug. So I’ll probably go back to wp 2.3 till this gets resolved.
April 4th, 2008 at 3:36 pm
I truly think that the WP devs should have tested the widgets options a lot more thoroughly, especially where usability is concerned. By removing the drag and drop fancy javascript (which is silly considering they decided to add fancy flash uploads and move the javascript to other places), and requiring a lot more mouse clicks to make simple changes, they went about 5 years backwards.
Billy, I’d recommend checking to see if the themes you’re using mixes both register_sidebar() and register_sidebars() functions; if so, the theme needs to be re-tweaked to use one or the other.
~ Teli
April 5th, 2008 at 8:59 pm
I’m not to sure how its exactly set up yet. It seems to use a separate script to add extra bars. I’m new to this but catching on fast. I switched from the sandbox to wordpress theme designer that this guy came out with a few weeks ago. I’m having much better luck with it since I’m used to working with dreamweaver. I really don’t care to spend my time working code even though I do have fun with it. I just want my site up lol