Skip to content

Instantly share code, notes, and snippets.

@lswilson
Created January 29, 2013 02:43
Show Gist options
  • Save lswilson/4661279 to your computer and use it in GitHub Desktop.
Save lswilson/4661279 to your computer and use it in GitHub Desktop.
// Activate all sidebars, override this to customize sidebar markup
function widgets_init() {
// If there aren't any sidebars, skip the rest
if ( !$this->sidebars || empty($this->sidebars) ) return;
// Otherwise, lets register all of them
foreach ( $this->sidebars as $id => $info ) {
register_sidebar(array(
'name' => esc_html( $info['name'] ),
'id' => $id,
'description' => esc_html( $info['description'] ),
'editable' => intval( $info['editable'] ),
'before_widget' => "\n\t\t\t" . '<li id="%1$s" class="widget %2$s">',
'after_widget' => "\n\t\t\t</li>\n",
'before_title' => "\n\t\t\t\t". '<h3 class="widget-title"><span class="widget-title-left"><span class="widget-title-right">',
'after_title' => '</span></span></h3>'."\n"
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment