Skip to content

Instantly share code, notes, and snippets.

@anatol06
Created May 6, 2018 18:16
Show Gist options
  • Save anatol06/34b3b2f27cde0e71d3628eb08bc5c6e1 to your computer and use it in GitHub Desktop.
Save anatol06/34b3b2f27cde0e71d3628eb08bc5c6e1 to your computer and use it in GitHub Desktop.
Regeister and init Sidebar and 4 footer widgets
// Widget Locations
function fc_init_widgets($id){
register_sidebar(array(
'name' => 'Sidebar',
'id' => 'sidebar',
'before_widget' => '<div class="sidebar-widget">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => 'Footer 1',
'id' => 'footer1',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => 'Footer 2',
'id' => 'footer2',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => 'Footer 3',
'id' => 'footer3',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
register_sidebar(array(
'name' => 'Footer 4',
'id' => 'footer4',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
}
add_action('widgets_init', 'fc_init_widgets');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment