Created
December 21, 2017 15:24
-
-
Save zainaali/ded2afe3d269ece87c1cafa7435a0e93 to your computer and use it in GitHub Desktop.
wp_nav_menu change sub-menu class name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function new_submenu_class($menu) { | |
$menu = preg_replace('/ class="sub-menu"/','/ class="yourclass" /',$menu); | |
return $menu; | |
} | |
add_filter('wp_nav_menu','new_submenu_class'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment