Site logo

[Resolved] Add arrows to submenu

Home Forums Support [Resolved] Add arrows to submenu

Home Forums Support Add arrows to submenu

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2188517
    fredparson

    This code does seem to work its supposed to add arrows to the sub menu. Anyone know whats wrong with the code?

    function be_arrows_in_menus( $item_output, $item, $depth, $args ) {
    
    	if( in_array( 'menu-item-has-children', $item->classes ) ) {
    		$arrow = 0 == $depth ? '<i class="icon-angle-down"></i>' : '<i class="icon-angle-right"></i>';
    		$item_output = str_replace( '</a>', $arrow . '</a>', $item_output );
    	}
    
    	return $item_output;
    }
    add_filter( 'walker_nav_menu_start_el', 'be_arrows_in_menus', 10, 4 );
    #2188547
    David
    Staff
    Customer Support

    Hi there,

    i am not sure why you need it as the GP Nav adds arrows for parent menu items.
    But i tested the code and it does work, as i can see the <i class="icon-angle-down"></i> HTML being output.
    That HTML looks like its reliant on the Font Awesome icon library which you would need to install or replace the HTML with a different icon/HTML symbol

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.