[Support request] Is it possible to change the icon of the mobile menu?

Home Forums Support [Support request] Is it possible to change the icon of the mobile menu?

Home Forums Support Is it possible to change the icon of the mobile menu?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1603516
    İsmihan

    I use 2 menus on my website.
    Can you help me change the icons on the main menu and secondary menu one or both of them on the mobile.

    #1603579
    David
    Staff
    Customer Support

    Hi there,

    you can use the follow PHP snippet to change the hamburger icon to a different SVG:

    add_filter( 'generate_svg_icon', function( $output, $icon ) {
        if ( 'menu-bars' === $icon ) {
            $svg = 'add your <svg>...</svg> here';
    
            return sprintf(
                '<span class="gp-icon %1$s">
                    %2$s
                </span>',
                $icon,
                $svg
            );
        }
    
        return $output;
    }, 15, 2 );

    You need to update this line to include your inline SVG: $svg = 'add your <svg>...</svg> here';

    #1940899
    cjenti

    hi! This is nice!
    Is it possible and what would be the snippet to change the mobile menu icon and the secondary menu icon individualy?
    Thanks in advance!

    #1941301
    David
    Staff
    Customer Support

    Hi there,

    unfortunately there isn’t a filter that differentiates between primary and secondary menus.
    You could use some CSS to hide the default icon and include an image using a CSS pseudo element.

    #1941817
    cjenti

    Ok, thanks!

    #1942710
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.