CSS Classes (optional) is not working on the ul li a?

I’m working on the working custom theme development where i need to add custom and additional class to the ul li a i have added extra class using CSS Classes (optional) but problem is that extra additional is not showing on the ul li a?

Walker_Nav_Menu

class Desktop_Walker_Nav_Menu extends Walker_Nav_Menu
{
function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
{
if (array_search(‘menu-item-has-children’, $item->classes)) {
$output .= sprintf(“n<li class=’nw_submenu %s’><a href=’%s’ class=”arrow_after” >%s <i class=’icon-angle-down’ ></i></a>n”, (array_search(‘current-menu-item’, $item->classes) || array_search(‘current-page-parent’, $item->classes)) ? ‘active’ : ”, $item->url, $item->title);
} else {
$output .= sprintf(“n<li class=”nw_submenu” %s><a href=’%s’>%s</a>n”, (array_search(‘current-menu-item’, $item->classes)) ? ” : ”, $item->url, $item->title);
}
}

function start_lvl(&$output, $depth = 0, $args = array())
{
$indent = str_repeat(“t”, $depth);
$output .= “n$indent<ul class=”nw_submenu_items” role=”menu”>n”;
}
}

Menu Called In Header

<?php
$defaults = array(
‘theme_location’ => ‘header-menu’,
‘container’ => ‘ul’,
‘menu_class’ => ‘nw_menu nav navbar-nav navbar-right’,
‘menu_id’ => ”,
‘walker’ => new Desktop_Walker_Nav_Menu()
);

wp_nav_menu( $defaults );

?>

Read more here:: CSS Classes (optional) is not working on the ul li a?

Leave a Reply

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