dane-m
10/25/2016 - 9:24 PM

Output the WordPress wp_nav_menu with no <li> tags #WordPress #wp_nav_menu

Output the WordPress wp_nav_menu with no

  • tags #WordPress #wp_nav_menu
  • <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>
    <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>