Skip to content

Instantly share code, notes, and snippets.

@joeyz
Created March 30, 2015 02:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeyz/01b654754aba1346e8ea to your computer and use it in GitHub Desktop.
Save joeyz/01b654754aba1346e8ea to your computer and use it in GitHub Desktop.
WP dynamic sidebar
//Goes in Functions.php
// Widgetized Sidebar
function lavish_widgets_init() {
register_sidebar( array(
'name' => 'left sidebar',
'id' => 'left_sidebar',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'lavish_widgets_init' );
//instantiate with
<?php dynamic_sidebar( 'left_sidebar' ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment