[Support request] Remove arrow dropdown in menu

Home Forums Support [Support request] Remove arrow dropdown in menu

Home Forums Support Remove arrow dropdown in menu

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1233644
    Fabien

    Hi there,

    Is there a function (not css display:none please) to remove the dropdown arrow in the menu ?

    Thanks,

    Fabien

    #1234167
    Leo
    Staff
    Customer Support

    Hi there,

    Would this CSS work for you?

    .dropdown-menu-toggle:before {
        content: none;
    }
    #1234839
    Fabien

    Not really as it still loads the svg code….

    #1235461
    Tom
    Lead Developer
    Lead Developer

    Try this:

    remove_filter( 'nav_menu_item_title', 'generate_dropdown_icon_to_menu_link', 10, 4 );

    #1686418
    Rafał

    Tom, how about mobile menu? They still exist there.

    #1687536
    Elvin
    Staff
    Customer Support

    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.

    #1690974
    Rafał

    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)

    #1691911
    Elvin
    Staff
    Customer Support

    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

    #1692016
    Rafał

    Thank you Elvin

    #1692017
    Elvin
    Staff
    Customer Support

    No problem. 🙂

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