Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TTB widgetruimte en menulocatie
//widgetruimte in footer. Adapted in functions.php
function haicu17_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'haicu17' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'haicu17' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer', 'haicu17' ),
'id' => 'footer-1',
'description' => esc_html__( 'Add widgets here.', 'haicu17' ),
'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', 'haicu17_widgets_init' );
//make it show up in the footer. Code added to footer.php
<?php dynamic_sidebar( 'footer-1' ); ?>
// This theme uses wp_nav_menu() in two locations. Adapted in functions.php
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'haicu17' ),
'secondary' => esc_html__( 'Secondary', 'haicu17' ),
) );
//make it show up in the footer. Code added to footer.php
<?php wp_nav_menu( array( 'theme_location' => 'secondary', 'menu_id' => 'secondary-menu' ) ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment