Archived topic
Remove arrow dropdown in menu
9 replies · Started by Fabien on April 10, 2020
Hi there,
Is there a function (not css display:none please) to remove the dropdown arrow in the menu ?
Thanks,
Fabien
Hi there,
Would this CSS work for you?
.dropdown-menu-toggle:before {
content: none;
}
Not really as it still loads the svg code....
Try this:
remove_filter( 'nav_menu_item_title', 'generate_dropdown_icon_to_menu_link', 10, 4 );
Tom, how about mobile menu? They still exist there.
Tom, how about mobile menu? They still exist there.
Any chance you can link us to the site/page in question to check?
If you must keep it private, can you open a new topic about this? So you can use the private information text field. Thank you.
In fact, SVG dropdown icons exist as before, in all navigation places.
I used this to force removing:
add_action( 'after_setup_theme', 'tu_remove_svg_dropdown_icons' );
function tu_remove_svg_dropdown_icons() {
remove_filter( 'nav_menu_item_title', 'generate_dropdown_icon_to_menu_link', 10, 4 );
}
The deal is not to remove whole SPAN.dropdown-menu-toggle, which is useful, but SVG node only.
So, can we override generate_get_svg_icon function or $icon* variable as empty only at this point?
*\wp-content\themes\generatepress\inc\structure\navigation.php:419 (v. 3.0.3)
So, can we override generate_get_svg_icon function or $icon* variable as empty only at this point?
Yeah you can do that because there's no other way to remove the icon without editing the actual code if we don't resort to this.
The icon is hardcoded to the menu's walker function as shown here: (same file you've mentioned)
https://github.com/tomusborne/generatepress/blob/7b35168f546f83a7abb098a8da3bc0674d49ddeb/inc/structure/navigation.php#L316
Thank you Elvin
No problem. :)