Skip to content

Instantly share code, notes, and snippets.

@Narga
Created November 27, 2012 01:49
Show Gist options
  • Save Narga/4151869 to your computer and use it in GitHub Desktop.
Save Narga/4151869 to your computer and use it in GitHub Desktop.
Use definition lists with wp_nav_menu
// Secondary Menu is Widgetable
function widget_secondary_navigation() {
$args = array(
'echo' => false,
'items_wrap' => '<dl id="%1$s" class="%2$s myclass">%3$s</dl>','theme_location' => 'secondary_navigation', 'container' => false, 'menu_class' => 'sub-nav'
);
$subject = wp_nav_menu( $args );
$search = array('<ul', '</ul>', '<li', '</li>');
$replace = array('<dl', '</dl>', '<dd', '</dd>');
echo str_replace($search, $replace, $subject);}
wp_register_sidebar_widget(
'1', // your unique widget id
'Secondary Navigation', // widget name
'widget_secondary_navigation', // callback function
array( // options
'description' => 'Display Secondary Navigation in sidebar'
)
);
<ul>
<li></li>
<li></li>
</ul>
<dl>
<dt><dt>
<dd></dd>
<dd></dd>
</dl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment