Skip to content

Instantly share code, notes, and snippets.

@jasonyingling
Last active November 24, 2015 15:57
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 jasonyingling/01333107fed9900f5d93 to your computer and use it in GitHub Desktop.
Save jasonyingling/01333107fed9900f5d93 to your computer and use it in GitHub Desktop.
Registering a Sidebar in WordPress
// Function to create widgetized area
function meetup_widgetized_area() {
$args = array(
'name' => __('Meetup Widgetized Area', 'sample-child'),
'id' => 'meetup-widgetized-area',
'description' => 'A sample widegetized area',
'class' => '',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
);
register_sidebar($args);
}
// Hook into the widgets_init() function and call our function to register our widgetized area
add_action( 'widgets_init', 'meetup_widgetized_area' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment