Skip to content

Instantly share code, notes, and snippets.

@leowebguy
Last active December 15, 2015 15:08
Show Gist options
  • Save leowebguy/18c87fa496a1a6fd8eda to your computer and use it in GitHub Desktop.
Save leowebguy/18c87fa496a1a6fd8eda to your computer and use it in GitHub Desktop.
WordPress register custom Widget
function custom_widget_init() {
register_sidebar( array(
'name' => 'Featured + Search',
'id' => 'featured_search1',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="featured_search1">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => 'Just Search',
'id' => 'featured_search2',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="featured_search2">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => 'Just Featured',
'id' => 'featured_search3',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h2 class="featured_search3">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'custom_widget_init' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment