Remove li Elements From wp_nav_menu

WordPress will allow you to modify or remove the <ul> element from wp_nav_menu but that’s it. You cannot remove the <li> items of the navigation by using the default parameters.

Using a simple PHP function, we can easily remove the li items as well, and this is how you can do it.

Leave a Reply

Your email address will not be published.