Skip to content

Instantly share code, notes, and snippets.

@grex22
Created November 19, 2013 22:08
Show Gist options
  • Save grex22/7553451 to your computer and use it in GitHub Desktop.
Save grex22/7553451 to your computer and use it in GitHub Desktop.
Updates to wp nav plus
function widget( $args, $instance ) {
extract($args);
if($before_widget) echo $before_widget;
$menu = wp_nav_plus(array('menu' => $instance['menu_term_id'], 'echo' => false, 'container' => false, 'items_wrap' => '%3$s', 'start_depth' => $instance['start_depth'], 'depth' => $instance['depth']));
if($instance['title']) {
if(!empty($menu)) { ?>
<h3 class="wp_nav_plus_title"><?=$instance['title'];?></h3>
<?php
}
}
if(!empty($menu)) {
wp_nav_plus(array('menu' => $instance['menu_term_id'], 'start_depth' => $instance['start_depth'], 'depth' => $instance['depth']));
}
if($after_widget) echo $after_widget;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment