Changing name of sidebar widget

Use the ‘Name’ parameter in your register_sidebar call. E.g., see the following code in the default Twenty Ten theme, line 351. function twentyten_widgets_init() { // Area 1, located at the top of the sidebar. register_sidebar( array( ‘name’ => __( ‘Primary Widget Area’, ‘twentyten’ ), ‘id’ => ‘primary-widget-area’, ‘description’ => __( ‘The primary widget area’, ‘twentyten’ … Read more

Hooking a function onto the sidebar?

Load at the sidebar bottom In most of the sidebars, you’ll find the call to the wp_meta() action hook, where you can hook into the (mostly bottom) of a sidebar. Load on top of your sidebar The function get_sidebar( $name ) calls the sidebar you want in your template (this allows to have different sidebars). … Read more

Best way of making multiple sidebars

Defining new sidebar with in your functions.php <?php if ( function_exists(‘register_sidebar’) ) { register_sidebar(array( ‘before_widget’ => ‘<li id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</li>’, ‘before_title’ => ‘<h2 class=”widgettitle”>’, ‘after_title’ => ‘</h2>’ )); }?> Once these are functions are defined, you will notice the extra sidebar appear in the WordPress Dashboard under the Appearance > Widgets option. … Read more

how do I get_sidebar into a varaible?

You probably need to use output buffering, if I understand your question correctly. Try something like this: ob_start(); dynamic_sidebar(‘sidebar-id’); $sidebar = ob_get_contents(); ob_end_clean(); That will put the output of the sidebar into the variable $sidebar, which you can then process and return from your filter on the page content.

What is the difference with get_sidebar and dynamic_sidebar?

Please refer to the get_sidebar() and dynamic_sidebar() Codex entries. The get_sidebar( $slug ) template tag includes the sidebar-$slug.php template-part file. The dynamic_sidebar( $slug ) template tag outputs the $slug dynamic sidebar, as defined by register_sidebar( array( ‘id’ => $slug ) ).

Get list of all registered sidebars

Hmm… I’m not sure if this is the best way to do it but it’s simple: I looked in register_sidebar() and found that new sidebars are simply tacked onto an array:$wp_registered_sidebars And I guess that’s that. If they ever change the name of the variable, I guess I’d be screwed.