Remove UI And LI Elements From wp_nav_menu

2022-11-17T17:52:34.000000Z byAdmin inWordPress
Remove UI And LI Elements From wp_nav_menu
You can remove or change the <ul> container and <li> that you get by default with wp_nav_menu (codex) through parameters, but you can’t remove the <ul>  and <li> elements that wrap each menu item. This is how you can actually remove them:

<?php
$menuParameters = array(
'theme_location' => 'footer', // Change Menu name
'container' => false,
'echo' => false,
'items_wrap' => '%3$s',
'depth' => 0,
);

echo strip_tags(wp_nav_menu( $menuParameters ), '' );
?>