I registered a sidebar widget, then modified the registration which included changing the registered name of the widget. Now the widget does not show at all. Below are the steps I took.
I registered a sidebar widget in my functions.php file.
if (function_exists('register_sidebar') ){ register_sidebar( array('name' => 'Right Sidebar') ); }
In my template page, I then dropped in the appropriate calls for the widget, like so...
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> ...some html... <?php endif; ?>
Then after doing some further reading in the codex (i'm a noob), I decided to do a bit more clean-up and test out all the parameters of register_sidebar(), so...
In functions.php, I CHANGED the call from the above to this (which is taken directly from the codex):
if (function_exists('register_sidebar') ){ register_sidebar(array( 'name' => 'RightSideBar', 'id' => 'right-sidebar', 'description' => 'Widgets in this area will be shown on the right-hand side.', 'before_title' => '<h1>', 'after_title' => '</h1>' )); }
I then went to Admin > Appearance and, sure enough the new and improved sidebar widget was showing, but was empty. So I added a few widgets.
I then tested the page in the browser: No Widgets. Just the default mark-up I added.
I checked the code. Looks right to my noob eyes.
So I decided to back out of the changes and reverted to the previous code (see step 1).
To my amazement, in the admin all the previous settings were still there (Sidebar, widgets and all)! Plus the widgets showed right up on the page.
Then I re-added the new code (see #4) and, same thing: All the widgets I added to the new and improved version also were saved (somewhere in the db, for some reason beyond my pay grade) and also showed (in the admin section, but NOT on the page).
This leads to the question: Do I need to (somehow) deregister the sidebar widget? ( since the DB is apparently storing these values "somewhere").
A bit more digging pulled up this little function: unregister_sidebar( $id );
Do I really need to use this? My original goal was to completely rename and update the sidebar.
So... I need a clue :D
Thanks,
sleeper