I’ve registered a new sidebar for an about section using the default wordpress code
add_action( 'widgets_init', 'my_register_sidebars' );
function my_register_sidebars() {
/* Register the 'primary' sidebar. */
register_sidebar(
array(
'id' => 'about',
'name' => __( 'About Sidebar' ),
'description' => __( 'About section sidebar' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
)
);
/* Repeat register_sidebar() code for additional sidebars. */
}
I showed the sidebar via a hook element and using the layout to display on the selected pages using the following content:
<?php dynamic_sidebar( 'right-sidebar' ); ?>
It works however I now have the default sidebar showing as well which I don’t need.
How can I unregister the default sidebar and show only the about one? Is this the best way to do this or should I do it another way i.e via a template?
I don’t want to use a plugin for the sidebars.
thanks
Jon