Skip to content

Instantly share code, notes, and snippets.

@haicu
Created November 24, 2016 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haicu/65fddc1c0a8d718e503c1fb640ad4bc7 to your computer and use it in GitHub Desktop.
Save haicu/65fddc1c0a8d718e503c1fb640ad4bc7 to your computer and use it in GitHub Desktop.
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