Skip to content

Instantly share code, notes, and snippets.

@jfeliweb
Created August 13, 2014 21:43
Show Gist options
  • Save jfeliweb/6b8548db701a07d075a6 to your computer and use it in GitHub Desktop.
Save jfeliweb/6b8548db701a07d075a6 to your computer and use it in GitHub Desktop.
Creating a Widget Area
<!-- Registering a Widget Area - in funuction.php -->
/**
* Register Widget Area.
*
*/
function jenesis_widgets_init() {
register_sidebar( array(
'name' => 'Header Sidebar',
'id' => 'header_sidebar',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'jenesis_widgets_init' );
<!-- Display Widget Area - on template page -->
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('header_sidebar') ) :
endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment