- This topic has 8 replies, 3 voices, and was last updated 5 years, 7 months ago by Tom.
-
AuthorPosts
-
September 17, 2018 at 4:07 am #679046Niklas
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,
NiklasSeptember 17, 2018 at 5:40 am #679108DavidStaffCustomer SupportHi there,
are you using a Mega Menu plugin?
September 17, 2018 at 5:48 am #679109NiklasHi 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 #679112DavidStaffCustomer 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?September 17, 2018 at 6:08 am #679118NiklasHi 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 #679127DavidStaffCustomer 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:
September 18, 2018 at 2:19 am #679913NiklasHi 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 #679943NiklasHi 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 #680370TomLead 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; } );
-
AuthorPosts
- You must be logged in to reply to this topic.