[Support request] How to add a custom SVG or img on sticky menu on mobile devices

Home Forums Support [Support request] How to add a custom SVG or img on sticky menu on mobile devices

Home Forums Support How to add a custom SVG or img on sticky menu on mobile devices

  • This topic has 1 reply, 2 voices, and was last updated 2 months ago by Ying.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2246048
    FunkyCss

    Hi there,

    So I am using this code to add a custom image for my slideout navigation menu togle

    
    
    add_filter( 'generate_svg_icon', function( $output, $icon ) {
        if ( 'pro-menu-bars' === $icon ) {
            $output = '/wp-content/uploads/burgerMenu.png';
        }
    
        return $output;
    }, 10, 2 );
    
    

    And this works perfectly fine, but I need the same to add it to mobile – can you please tell me the filter name for this one ?

    Thank you in advance

    #2246396
    Ying
    Staff
    Customer Support

    Hi there,

    Try this:

    add_filter( 'generate_svg_icon_element', function( $output, $icon ) {
        if ( 'menu-bars' === $icon ) {
            $output = '<svg>Your-custom-search-icon</svg>';
        }
        return $output;
    }, 10, 2 );
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.