Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@reneeschel
Created April 28, 2014 04:53
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 reneeschel/11362086 to your computer and use it in GitHub Desktop.
Save reneeschel/11362086 to your computer and use it in GitHub Desktop.
widget in nav wrap
genesis_register_sidebar( array(
'id' => 'nav-widget',
'name' => __( 'Nav Menu Widget', 'A Sample' ),
'description' => __( 'This is your custom nav menu widget.', 'wpsites.net' ),
) );
add_filter( 'wp_nav_menu_items', 'nav_menu_widget', 10, 2 );
add_filter('widget_text', 'do_shortcode');
//* Credit to http://www.rfmeier.net/ for part of this code.
function nav_menu_widget( $menu, stdClass $args ){
genesis_structural_wrap( 'widget');
//Change primary to secondary here if needed
if ( 'primary' != $args->theme_location )
return $menu;
if( genesis_get_option( 'nav_extras' ) )
return $menu;
if ( is_active_sidebar( 'nav-widget' ) )
genesis_widget_area( 'nav-widget', array(
'before' => '<div class="nav-widget widget-area">',
'after' => '</div>',
) );
genesis_structural_wrap( 'widget', 'close');
echo '</div>';
return $menu;
}
@reneeschel
Copy link
Author

widget for nav within the wrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment