My site uses the WordPress Appearance > Menus to create the <ul>
and sub elements for my navigation links.
I am using a function in functions.php to add the class navbar-nav to the <ul>
element like this:
function add_link_atts($atts) {
$atts['class'] = "nav-link";
return $atts;
}
add_filter( 'nav_menu_link_attributes', 'add_link_atts');
But how can I add 2 extra classes? namely nav-fill and w-100
I tried this but don't think its working:
function add_link_atts($atts) {
$atts['class'] = "nav-link nav-fill w-100";
return $atts;
}
add_filter( 'nav_menu_link_attributes', 'add_link_atts');
How can I add these two extra classes?