Skip to content

Instantly share code, notes, and snippets.

@glyons
Created August 19, 2018 05:34
Show Gist options
  • Save glyons/1b537ea30cd633641e8fbfd7cb081b32 to your computer and use it in GitHub Desktop.
Save glyons/1b537ea30cd633641e8fbfd7cb081b32 to your computer and use it in GitHub Desktop.
Hamilton Theme - Add Widget Support (Add to the top of each PHP file)
<!-- Need to add CSS styling -->
/**
* Footer Widgets
*
*/
function footerL_widgets_init() {
register_sidebar( array(
'name' => 'Footer Left',
'id' => 'footer_left',
'before_widget' => '<div class="footer-widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'footerL_widgets_init' );
function footerC_widgets_init() {
register_sidebar( array(
'name' => 'Footer Centre',
'id' => 'footer_centre',
'before_widget' => '<div class="footer-widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'footerC_widgets_init' );
function footerR_widgets_init() {
register_sidebar( array(
'name' => 'Footer Right',
'id' => 'footer_right',
'before_widget' => '<div class="footer-widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="rounded">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'footerR_widgets_init' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment