Support » Theme: Grow » custom menu for responsive mode

  • Hello,
    I’m using a child theme of Grow and would like to use a different menu in the mobile view. I am almost there but unable to override the function thinkup_input_responsivehtml2() in the child functions.php without getting a fatal error. I tried a few methods that i know of.
    Now resorted to editing the parent theme file: admin/main/options/01.general-settings.php in the meantime and it works well.

    In the child theme i have:

    add_action( 'after_setup_theme', 'register_mobile_menu' );
    function register_mobile_menu() {
      register_nav_menu( 'mobile_menu', __( 'Mobile Menu', 'grow-child' ) );
    }

    The modified function in general-settings line 414:

    function thinkup_input_responsivehtml2() {
    global $thinkup_general_fixedlayoutswitch;
    
    	if ( $thinkup_general_fixedlayoutswitch !== '1' ) {
    // check for mobile
    		if ( wp_is_mobile() ) {
    			$menu_loc = 'mobile_menu';
    				} else {
    			$menu_loc = 'header_menu';
    				}
    //
    		$args =  array(
    			'container_class' => 'responsive-links nav-collapse collapse', 
    			'container_id'    => 'header-responsive-inner', 
    			'menu_class'      => '', 
    			'theme_location'  => $menu_loc, // <- variable from wp_is_mobile
    			'walker'          => new thinkup_nav_menu_responsive(), 
    			'fallback_cb'     => 'thinkup_input_responsivefall',
    		);
    
    		echo '<div id="header-responsive">',
    		     wp_nav_menu( $args ),
    		     '</div>';
    	}
    }
    
Viewing 1 replies (of 1 total)
  • Hi Hafman,

    Sorry, the customization isn’t supported. If that’s something you really need, you can always try to hire a developer for this task, who can assist you in getting this done.

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘custom menu for responsive mode’ is closed to new replies.