Skip to content

Instantly share code, notes, and snippets.

@ABooooo
Created February 8, 2019 09:40
Show Gist options
  • Save ABooooo/af6185ff2430d84c46be2ab98d3ee6bd to your computer and use it in GitHub Desktop.
Save ABooooo/af6185ff2430d84c46be2ab98d3ee6bd to your computer and use it in GitHub Desktop.
// register sidebar in functions
function alle_sprachen_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'alle_sprachen' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'alle_sprachen' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'alle_sprachen_widgets_init' );
// include sidebar in template
<?php dynamic_sidebar( 'footer-center' ); ?> // footer-center is sidebare name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment