Skip to content

Instantly share code, notes, and snippets.

@spraveenitpro
Created February 7, 2014 12:43
Show Gist options
  • Save spraveenitpro/8862016 to your computer and use it in GitHub Desktop.
Save spraveenitpro/8862016 to your computer and use it in GitHub Desktop.
Registering a Sidebar
Functions.php
<?php
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' => 'sidebar',
'id' => 'sidebar',
'description' => 'The default Sidebar',
'before_widget' => '<div class="sidebar-box">',
'after_widget' => '</div>',
'before_title' => '<span class="sidebar-title">',
'after_title' => '</span><div class="dots"></div>',
));
}
?>
Sidebar.php
<div id="sidebar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("sidebar") ) : endif; ?>
</div><!-- sidebar -->
Index.php
<?php get_sidebar(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment