I'm trying to install a sidebar in my custom-theme.
functions.php:
<?php
/**
* Register our sidebars and widgetized areas.
*
*/
function arphabet_widgets_init() {
register_sidebar( array(
'name' => 'sidebar',
'id' => 'sidebar',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'arphabet_widgets_init' );
?>
sidebar.php:
<div class="sidebar">
<?php if ( is_active_sidebar( 'sidebar' ) ) : ?>
<div id="sidebar" class="primary-sidebar widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar' ); ?>
</div><!-- #primary-sidebar -->
<?php endif; ?>
</div>
On my widgets page in the admin area I now see a widget box called sidebar and i've put a Custom Menu in it. I've also given the div .sidebar
a colour in CSS.
but i don't see anything on the website itself. Any idea what i'm missing?