I have a custom post type called “bibliographies” and the corresponding archive-bibliographies.php file to show a list of posts. On this page I want to add a side bar that is unique to this page, so I went ahead and registered a new sidebar like this:
// Register Bibliography Sidebar
function bibliography_sidebar() {
register_sidebar( array(
'name' => 'bibliography_sidebar',
'id' => 'bibliography_sidebar',
'description' => __( 'Widgets in this area will be shown on the bibliography sidebar.', 'theme-slug' ),
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="bibliography_sidebar">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'bibliography_sidebar' );
then on the archive-bibliopgraphies.php file I’m trying to call the sidebar like this:
get_sidebar('bibliography_sidebar');
I see the new side bar on the admin side and I’m able to add widgets to it, but on the front end all I get is the main side bar, not the “bibliography_sidebar” sidebar.
Any ideas what I’m missing here?