• Resolved offpeakdesign

    (@offpeakdesign)


    Hi, wondering if anyone can help me figure out how to change the displayed name of “Main Sidebar” within the widget editing dashboard. I have a child theme and child functions file, but simply copying and pasting the registered sidebar, then modifying the name in my child functions file doesn’t have any affect.

    In original functions file:

    register_sidebar( array(
    		'name' => __( 'Main Sidebar', 'twentyeleven' ),
    		'id' => 'sidebar-1',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );

    In child functions file:

    register_sidebar( array(
    		'name' => __( 'NEWNAME Sidebar', 'twentyeleven' ),
    		'id' => 'sidebar-1',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter offpeakdesign

    (@offpeakdesign)

    I actually found this and applied it, which seems to affect the widgets, but still doesn’t override the name for some reason…

    remove_action( 'widgets_init', 'twentyeleven_widgets_init' );
    
    function ofpk_widgets_init() {
    
       	register_sidebar( array(
    		'name' => __( 'NEWNAME Sidebar', 'twentyeleven' ),
    		'id' => 'sidebar-1',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );
    
    }
    add_action( 'widgets_init', 'ofpk_widgets_init' );
    Thread Starter offpeakdesign

    (@offpeakdesign)

    Found out what I needed to add:

    // My Child Theme Setup
    add_action( 'after_setup_theme', 'twentyeleven_child_theme_setup', 11 );
    
    function twentyeleven_child_theme_setup() {
    
    new widget code
    
    }

    Realized that the child function file was recognized first, and needed to be recognized after the original function file. Reference link

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘rename 'Main Sidebar' in widget editing dashboard’ is closed to new replies.