Remove the ul class from the wp_nav_menu

Webmaster WordPress Leave a Comment

Removes the ul class from the wp_nav_menu

Place the code below into your themes functions.php template between the <?php.

// Removes ul class from wp_nav_menu

function remove_ul ( $menu ){
return preg_replace( array( '#^<ul[^>]*>#', '#</ul>$#' ), '', $menu );
}
add_filter( 'wp_nav_menu', 'remove_ul' );

Leave a Reply

Your email address will not be published. Required fields are marked *