Custom sidebar not showing in the dashboard

Register sidebar.

add_action( 'widgets_init', 'wpse_123456_widgets_init' );
function wpse_123456_widgets_init() {
    $args = array(
        'name'          => __( 'Sidebar name', 'theme_text_domain' ),
        'id'            => 'unique-sidebar-id',
        'description'   => '',
         'class'         => '',
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget'  => '</li>',
        'before_title'  => '<h2 class="widgettitle">',
        'after_title'   => '</h2>' );

    if ( function_exists ('register_sidebar')) {
      register_sidebar( $args );
    }
}

Call the sidebar.

if ( is_active_sidebar('unique-sidebar-id') {
 dynamic_sidebar('unique-sidebar-id') );
}

Leave a Comment