- This topic has 4 replies, 3 voices, and was last updated 2 years, 4 months ago by Fernando.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
September 5, 2022 at 8:04 am #2334035Antonio
Hello,
is there a way to replace the full screen menu icon with a svg using function php?Thank you
September 5, 2022 at 8:55 am #2334064DavidStaffCustomer SupportHi there,
try this:
add_filter( 'generate_svg_icon', function( $output, $icon ) { if ( 'pro-menu-bars' === $icon ) { $svg = 'your SVG HTML goes here'; return sprintf( '<span class="gp-icon %1$s"> %2$s </span>', $icon, $svg ); } return $output; }, 15, 2 );
September 5, 2022 at 9:36 am #2334090AntonioHello,
not working with my setup.Please note I also have this code to replace the open menu btn:
add_filter( 'generate_svg_icon', function( $output, $icon ) { if ( 'menu-bars' === $icon ) { $svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 91.9 61.2" style="enable-background:new 0 0 91.9 61.2" xml:space="preserve"><path d="M30.6 30.6h30.6v30.6H30.6zM0 0h30.6v30.6H0zm61.3 0h30.6v30.6H61.3z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#fff"/></svg>'; return sprintf( '<span class="gp-icon %1$s"> %2$s </span>', $icon, $svg ); } return $output; }, 15, 2 );
Thank you
September 5, 2022 at 11:11 am #2334153AntonioSorry, I was not really clear. I’d like to replace the CLOSING menu icon.
September 5, 2022 at 6:04 pm #2334301Fernando Customer SupportHi Antonio,
Are you planning to use the same logo as your menu toggle?
If so, you can try this:
add_filter( 'generate_svg_icon', function( $output, $icon ) { if ( 'menu-bars' === $icon || 'pro-close' === $icon ) { $svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 91.9 61.2" style="enable-background:new 0 0 91.9 61.2" xml:space="preserve"><path d="M30.6 30.6h30.6v30.6H30.6zM0 0h30.6v30.6H0zm61.3 0h30.6v30.6H61.3z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#fff"/></svg>'; return sprintf( '<span class="gp-icon %1$s"> %2$s </span>', $icon, $svg ); } return $output; }, 15, 2 );
If not, use this:
add_filter( 'generate_svg_icon', function( $output, $icon ) { if ( 'menu-bars' === $icon ) { $svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 91.9 61.2" style="enable-background:new 0 0 91.9 61.2" xml:space="preserve"><path d="M30.6 30.6h30.6v30.6H30.6zM0 0h30.6v30.6H0zm61.3 0h30.6v30.6H61.3z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#fff"/></svg>'; return sprintf( '<span class="gp-icon %1$s"> %2$s </span>', $icon, $svg ); } else if ( 'pro-close' === $icon ) { $svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 91.9 61.2" style="enable-background:new 0 0 91.9 61.2" xml:space="preserve"><path d="M30.6 30.6h30.6v30.6H30.6zM0 0h30.6v30.6H0zm61.3 0h30.6v30.6H61.3z" style="fill-rule:evenodd;clip-rule:evenodd;fill:#fff"/></svg>'; return sprintf( '<span class="gp-icon %1$s"> %2$s </span>', $icon, $svg ); } return $output; }, 15, 2 );
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.