5

I have created dynamic sidebars. They are working fine and appear in the Widgets area.

However, I would like to customize the name that appears on each sidebar.

So, right now each sidebar is named "Sidebar 1", "Sidebar 2", etc.

Instead, I would like them to say something like "About Sidebar", "Toolkit Sidebar".

This is not the title (that field is blank and the user can enter whatever text they please).

Thank you for any help! Jeff

I am not sure how to do that.

5

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' ),
        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h3 class="widget-title">',
        'after_title' => '</h3>',
    ) );

    // Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
    register_sidebar( array(
        'name' => __( 'Secondary Widget Area', 'twentyten' ),
        'id' => 'secondary-widget-area',
        'description' => __( 'The secondary widget area', 'twentyten' ),
        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h3 class="widget-title">',
        'after_title' => '</h3>',
    ) );

    // Area 3, located in the footer. Empty by default.
    register_sidebar( array(
        'name' => __( 'First Footer Widget Area', 'twentyten' ),
        'id' => 'first-footer-widget-area',
        'description' => __( 'The first footer widget area', 'twentyten' ),
        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h3 class="widget-title">',
        'after_title' => '</h3>',
    ) );

    // Area 4, located in the footer. Empty by default.
    register_sidebar( array(
        'name' => __( 'Second Footer Widget Area', 'twentyten' ),
        'id' => 'second-footer-widget-area',
        'description' => __( 'The second footer widget area', 'twentyten' ),
        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h3 class="widget-title">',
        'after_title' => '</h3>',
    ) );

    // Area 5, located in the footer. Empty by default.
    register_sidebar( array(
        'name' => __( 'Third Footer Widget Area', 'twentyten' ),
        'id' => 'third-footer-widget-area',
        'description' => __( 'The third footer widget area', 'twentyten' ),
        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h3 class="widget-title">',
        'after_title' => '</h3>',
    ) );

    // Area 6, located in the footer. Empty by default.
    register_sidebar( array(
        'name' => __( 'Fourth Footer Widget Area', 'twentyten' ),
        'id' => 'fourth-footer-widget-area',
        'description' => __( 'The fourth footer widget area', 'twentyten' ),
        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h3 class="widget-title">',
        'after_title' => '</h3>',
    ) );
}
/** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */
add_action( 'widgets_init', 'twentyten_widgets_init' );
  • great, thank you. What if I wanted different names for each sidebar I register? I realize that I probably need an array, but I am still a PHP newbie. – Jeff Tancil Oct 18 '10 at 17:35
  • I posted the full twenty ten code, just follow the same pattern. – sorich87 Oct 18 '10 at 17:57
-1

The easiest way is; Appearance/Sidebars , on the right Add a New Sidebar, type a name, click on Add Sidebar. Add as many as you wish, and then add Widgets to these Sidebars in the Appearance/Widgets section.

  • 1
    Thank you for your answer, but WordPress core does not provide the functionality that you describe. This behavior is probably provided by a plugin that's installed on your setup. – Dave Romsey Feb 13 '18 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.