Skip to content

Instantly share code, notes, and snippets.

@Irfan-Ansari
Created February 26, 2015 11:45
Show Gist options
  • Save Irfan-Ansari/a686a72785711a2b7e41 to your computer and use it in GitHub Desktop.
Save Irfan-Ansari/a686a72785711a2b7e41 to your computer and use it in GitHub Desktop.
Register and call wdiget area in wordpress
<?php
/**
* Register Widget Area.
*
*/
function wpgyan_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', 'wpgyan_widgets_init' );
/**
* call Widget Area.
*
*/
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('mailchimp_story_widget') ) :
endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment