Last active
January 23, 2024 19:07
-
-
Save prosantamazumder/6710a6af0c6272162f2dbc78a9566bca to your computer and use it in GitHub Desktop.
// let's add our custom class to the actual link tag
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
// let's add our custom class to the actual link tag | |
function atg_menu_classes($classes, $item, $args) { | |
if($args->theme_location == 'primary') { | |
$classes[] = 'nav-link'; | |
} | |
return $classes; | |
} | |
add_filter('nav_menu_css_class', 'atg_menu_classes', 1, 3); | |
function add_menuclass($ulclass) { | |
return preg_replace('/<a /', '<a class="nav-link dropdown-toggle"', $ulclass); | |
} | |
add_filter('wp_nav_menu','add_menuclass'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment