Created
August 13, 2014 21:43
-
-
Save jfeliweb/6b8548db701a07d075a6 to your computer and use it in GitHub Desktop.
Creating a Widget Area
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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