• nebadita

    (@nebadita)


    Good evening,

    I am currently using Generate press version 3.1.0 free one. Facing some problem while trying to replace my menu with mega menu. Functions of menu are smoothly working in desktop but not supported in mobile. Despite of using some codes provided by generatepress for mobile menu i.e., nav .main-nav .mega-menu > ul > li > a {
    display: none;
    }
    so please fix this issue and intimate the way to apply the function.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Leo

    (@leohsiang)

    Hi there,

    Any chance you can link us to the site in question?

    Let me know ??

    Thread Starter nebadita

    (@nebadita)

    I am using AP mega menu. But after activating it was not working at first. So, after that putting this code

    function megamenu_remove_main_navigation_class( $classes ) {
    	$new_classes = array();
    
    	foreach ($classes as $class) {
    		if ($class != 'main-navigation') {
    			$new_classes[] = $class;
    		}
    	}
    
    	return $new_classes;
    }
    add_filter("generate_navigation_class", "megamenu_remove_main_navigation_class", 11);

    it appears in desktop but not on mobile..

    here’s the link of my site.. please check it- https://freaktofit.com/

    thanks..

    Leo

    (@leohsiang)

    Hmm have you checked with the plugin author on this first?

    Thread Starter nebadita

    (@nebadita)

    No, as whatever mega menu plugin i am installing the problem is same.. please help me with this issue..

    Elvin

    (@ejcabquina)

    Hi @nebadita,

    I’m not fully sure what you’re trying to do but I’ve checked your site and I don’t think the menu was replaced by a menu plugin.

    Replacing the menu plugin requires unhooking things.

    If you’ve set the primary navigation to “float right” then you can remove it by using this PHP snippet:

    add_action('after_setup_theme', function(){
    	remove_action( 'generate_after_header_content', 'generate_add_navigation_float_right', 5 );
    });

    And then you can re-add a menu from your plugin using the same hook and priority where the menu was removed.

    add_action( 'generate_after_header_content', function(){
    //do your thing here. if the plugin has a shortcode you can use do_shortcode() here
    }, 5 )
    Thread Starter nebadita

    (@nebadita)

    ok.. let me check by your code and will let you know

    Thread Starter nebadita

    (@nebadita)

    i add this code but its totally removing menu. As of now i set default menu as the mega menu is not working at all in the mobile. its expanding but inside none of the submenus are showing

    Elvin

    (@ejcabquina)

    i add this code but its totally removing menu.

    Yes that was the goal of the snippet. It’s meant to remove the default menu so you can add in your own menu coming from a mega menu plugin.

    This way you don’t have to rely on the default menu’s hamburger and do some display:none custom CSS styling as we’re completely leaving everything to the plugin you use as mega menu.

    After completely removing the default menu and adding your own custom menu, make sure you clean up the CSS as well. ??

    Thread Starter nebadita

    (@nebadita)

    Ok.. I will check and will let you know..

    Thread Starter nebadita

    (@nebadita)

    as per your way i did everything.. but still the issue is same. how can submenu be displayed for mobile in generatepress for mega menu?

    Elvin

    (@ejcabquina)

    how can submenu be displayed for mobile in generatepress for mega menu?

    Not exactly sure what you mean.

    I’ve checked the site and the submenu is displaying as shown here – https://share.getcloudapp.com/YEuPJ1Pj

    Perhaps you meant, you want the submenu to be expanded automatically?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Mega menu not supported in mobile version’ is closed to new replies.