- This topic has 9 replies, 4 voices, and was last updated 3 years, 2 months ago by
David.
-
AuthorPosts
-
January 3, 2021 at 3:45 am #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.January 3, 2021 at 6:09 am #1603579David
StaffCustomer SupportHi 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';September 23, 2021 at 1:50 pm #1940899cjenti
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!September 24, 2021 at 4:15 am #1941301David
StaffCustomer SupportHi 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.September 24, 2021 at 9:14 am #1941817cjenti
Ok, thanks!
September 25, 2021 at 9:41 am #1942710David
StaffCustomer SupportYou’re welcome
January 20, 2023 at 2:59 am #2502594Mårten
Hi,
I tried using the code below to replace the hamburger icon but it didn’t work.
Should I put the URL of my own icon between <svg> and </svg>?
January 20, 2023 at 4:15 am #2502674David
StaffCustomer SupportHi there,
do you have
.svgfile for the icon ?January 20, 2023 at 4:55 am #2502724Mårten
Hi,
Yes I have. I have created my own svg file.
January 20, 2023 at 4:59 am #2502728David
StaffCustomer SupportUse this site:
https://jakearchibald.github.io/svgomg/
To upload your SVG and it with return the SVG HTML which will look something like:
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-alarm-fill" viewBox="0 0 16 16"> <path d="M6 .5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1H9v1.07a7.001 7.001 0 0 1 3.274 12.474l.601.602a.5.5 0 0 1-.707.708l-.746-.746A6.97 6.97 0 0 1 8 16a6.97 6.97 0 0 1-3.422-.892l-.746.746a.5.5 0 0 1-.707-.708l.602-.602A7.001 7.001 0 0 1 7 2.07V1h-.5A.5.5 0 0 1 6 .5zm2.5 5a.5.5 0 0 0-1 0v3.362l-1.429 2.38a.5.5 0 1 0 .858.515l1.5-2.5A.5.5 0 0 0 8.5 9V5.5zM.86 5.387A2.5 2.5 0 1 1 4.387 1.86 8.035 8.035 0 0 0 .86 5.387zM11.613 1.86a2.5 2.5 0 1 1 3.527 3.527 8.035 8.035 0 0 0-3.527-3.527z"/> </svg>Copy and paste that into the
$svg = '' -
AuthorPosts
- You must be logged in to reply to this topic.