Skip to content

Instantly share code, notes, and snippets.

@hlashbrooke
Created July 12, 2013 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlashbrooke/5983657 to your computer and use it in GitHub Desktop.
Save hlashbrooke/5983657 to your computer and use it in GitHub Desktop.
WordPress: Create a new widget area
<?php
function register_widget_area() {
register_sidebar( array(
'name' => 'Widget Area Name',
'id' => 'new_widget_area',
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h1 class="title">',
'after_title' => '</h1>',
) );
}
add_action( 'widgets_init', 'register_widget_area' );
?>
<?php dynamic_sidebar( 'new_widget_area' ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment