Hello Readers,
If you want to remove default <div> and <li> tags from the WP menu, you can use below code.
It will remove the default <div> Tag and default <ul> Tag from your menu item.
The defualt Wp code is below
<?php wp_nav_menu(); ?>
The above code generates lots of unwanted html tags which are not useful for the WP menu such as, as mentioned above it creates <div> and <ul> tag. so instead of the above code you can use below code.
<?php
wp_nav_menu( array( 'container' => '', 'container_class' => '', 'container_id' => '', 'items_wrap' => '%3$s', 'theme_location' => 'tertiary' ) );
}
?>
0 Comment(s)