- This topic has 26 replies, 4 voices, and was last updated 3 years, 6 months ago by
Fernando.
-
AuthorPosts
-
September 3, 2022 at 1:21 am #2332154
Antonio
Hello,
I did the following:1) added the following code to the function.php file of the child theme:
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 );2) Moved to Customizer > Layout > Off Canvas Panel and set the Offcanvas panel this way: https://prnt.sc/p1wmVoJvax1w
3) Moved to Appearence > Menu and did the following: https://prnt.sc/mi9HGtrhFfH0
3) modify the header element as follows: https://prnt.sc/yDB9d9mraQX9Still I see the full menu and can’t see the SVG icon: https://prnt.sc/TlyaTjqzARBX
Where am I wrong?
Thank youSeptember 3, 2022 at 12:33 pm #2332624Ying
StaffCustomer Support1. If you keep using the
block element - site header, the off-canvas panel can not be opened.2. The navigation block you added to the element is a WP core block, it’s not related to GP’s off canvas panel.
Can you follow the below steps?
1) disable the
block element - site header, use the default GP header instead.
2) set the off canvas menu toonat customzier > layout > off canvas panel.
3) change Fernando’s codemenu-barstopro-menu-bars.Let me know!
September 4, 2022 at 2:17 am #2332881Antonio
Hello,
done it, but still there are some problems:1) SVG icon is not the one I’ve set: https://prnt.sc/gH0Qg5BdgTNt
Here’s the code:
add_filter( 'generate_svg_icon', function( $output, $icon ) { if ( 'pro-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 );2) color settings are not working: https://prnt.sc/Lz9cwdi7cMDN
Also: is there a way to show the Tagline of the Site title?
Thank you
September 4, 2022 at 5:45 pm #2333380Fernando Customer Support
Try this code:
add_filter( 'generate_svg_icon', function( $output, $icon ) { if ( 'pro-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 );Tested this on my site and it’s working.
Try clearing cache after adding this. If that doesn’t work, try adding it through Code Snippets as well.
September 5, 2022 at 12:22 am #2333530Antonio
Hello,
the code you sent me was exactly the same as the one I was using. Can you please login to the website and check the issue?
Thank youSeptember 5, 2022 at 12:28 am #2333535Fernando Customer Support
I see. Can you try this instead?:
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 );September 5, 2022 at 12:42 am #2333541Antonio
Same.
Can you please login to the website and check the issue?
September 5, 2022 at 12:52 am #2333549Fernando Customer Support
I see. I updated the code above. Can you try that instead?: https://generatepress.com/forums/topic/off-canvas-panel-not-showing-up/page/2/#post-2333535
September 5, 2022 at 12:56 am #2333553Antonio
It works.
I still have the following issue:
2) color settings are not working: https://prnt.sc/Lz9cwdi7cMDN
Thank you
September 5, 2022 at 1:01 am #2333554Fernando Customer Support
Try changing the colors in the Primary Navigation colors.
September 5, 2022 at 7:29 am #2333854Antonio
Works now, thank you!
September 5, 2022 at 5:03 pm #2334282Fernando Customer Support
You’re welcome Antonio!
-
AuthorPosts
- You must be logged in to reply to this topic.