To remove ul class from wp_nav_menu(), you will have to define menu_class to false. Default wp_nav_menu ul menu class is menu. Add the following code to the functions.php file of your current activated WordPress theme.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | function wp_nav_menu_no_ul() { $options = array( 'echo' => false, 'container' => false, 'theme_location' => 'primary', 'fallback_cb'=> 'fall_back_menu' ); $menu = wp_nav_menu($options); echo preg_replace(array( '#^<ul[^>]*>#', '#</ul>$#' ), '', $menu); } function fall_back_menu(){ return; } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.