Skip to content

Instantly share code, notes, and snippets.

@danemorgan
Created October 25, 2016 21:24
Show Gist options
  • Save danemorgan/6ae69f0cb560f8399d21b9f022def27c to your computer and use it in GitHub Desktop.
Save danemorgan/6ae69f0cb560f8399d21b9f022def27c to your computer and use it in GitHub Desktop.
Output the WordPress wp_nav_menu with no <li> tags #WordPress #wp_nav_menu
<div class="menu-class">
<?php
$menuParameters = array(
'theme_location' => 'button_menu',
'container' => false,
'echo' => false,
'link_before' => '<span>',
'link_after' => '</span>',
'items_wrap' => '%3$s',
'depth' => 0,
);
echo strip_tags(wp_nav_menu( $menuParameters ), '<a>, <span>' );
?>
</div>
<div class="menu-cass">
<?php
$menuParameters = array(
'theme_location' => 'button_menu',
'container' => false,
'echo' => false,
'items_wrap' => '%3$s',
'depth' => 0,
);
echo strip_tags(wp_nav_menu( $menuParameters ), '<a>' );
?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment