- This topic has 8 replies, 3 voices, and was last updated 3 years, 8 months ago by
Tom.
-
AuthorPosts
-
September 17, 2018 at 4:07 am #679046
Niklas
Hi,
i would like to use the mega menu. To make it work i need to remove the “main-navigation” class of the nav can you please tell me how to solve this?
<nav itemtype="https://schema.org/SiteNavigationElement" itemscope="itemscope" id="site-navigation" class="main-navigation grid-container grid-parent"></nav>
Thank you and best regards,
NiklasGeneratePress 2.1.4GP Premium 1.7.2September 17, 2018 at 5:40 am #679108David
StaffCustomer SupportHi there,
are you using a Mega Menu plugin?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 17, 2018 at 5:48 am #679109Niklas
Hi David,
thanks for your reply.
Yes, i am using the “megamenu” plugin. The support of that plugin told me to remove that class to solve my problem.
I am not sure how to handle it.September 17, 2018 at 5:56 am #679112David
StaffCustomer SupportLittle confused, i would assume the megamenu plugin should replace the GP Navigation entirely.
What is the problem? Is the megamenu not displaying? Can you share a link to the site?Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 17, 2018 at 6:08 am #679118Niklas
Hi David,
That is the link of the site. I am using the woocommerce plugin as well and would like to put certain products into the mega menu. This is not working. But is does work, when you remove the class “main-navigation” class out of the nav element.
BR
NiklasSeptember 17, 2018 at 6:30 am #679127David
StaffCustomer SupportAs per the WP topic here:
https://wordpress.org/support/topic/woocommerce-shortcodes-in-the-grid-layout/#post-10695125You would need to add this function. There are alternatives to using a child theme such as adding the code to the Code Snippets plugin:
https://docs.generatepress.com/article/adding-php/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 18, 2018 at 2:19 am #679913Niklas
Hi David,
thank you for the support but that doesn’t work.
If I paste the code into the snippets plugin it says:
The code snippet you are trying to save produced a fatal error on line 14:
Cannot redeclare mega_menu_remove_main_navigation_class() (previously declared in /www/htdocs/w0135547/xxx/wp-content/plugins/megamenu-edit/megamenu-edit.php:13)Is there another way to remove that specific class?
Regards,
NiklasSeptember 18, 2018 at 3:07 am #679943Niklas
Hi David,
I could fix it by using that css code:
.mega-menu-primary .main-navigation ul ul { height: auto; background: transparent; position: relative; left: auto; width: auto; box-shadow: none; pointer-events: auto; opacity: 1; }
Thank you & regards,
NiklasSeptember 18, 2018 at 9:49 am #680370Tom
Lead DeveloperLead DeveloperIf you need to remove that class (not recommended), you can do this:
add_filter( 'generate_navigation_class', function( $classes ) { $classes = array_diff( $classes, array( 'main-navigation' ) ); return $classes; } );
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.