[Resolved] WPGlobus in mobile view don't allow select languages. Web menu problem?

Home Forums Support [Resolved] WPGlobus in mobile view don't allow select languages. Web menu problem?

Home Forums Support WPGlobus in mobile view don't allow select languages. Web menu problem?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1048267
    Daniel G贸mez

    I’ve a multilingual site, using the WPGlobus plugin. Actually all works fine when is in desktop view, but when pass to mobile view doesn’t permite select a language, the little arrow what don’t appear in the menu for switch in the languages. Why happen this problem?
    Thanks for all.

    #1048378
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It looks like the arrow has been removed on desktop as well – are you using a function to remove the arrow possibly?

    Let me know 馃檪

    #1048499
    Daniel G贸mez

    I don’t use any function to remove the arrows. Only I install and configure the plugin normally, without extras functions.
    Thanks!

    #1048967
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this function:

    add_filter( 'nav_menu_item_title', function( $title, $item, $args, $depth ) {
    	$role = 'presentation';
    	$tabindex = '';
    	
    	if ( 'click-arrow' === generate_get_option( 'nav_dropdown_type' ) ) {
    		$role = 'button';
    		$tabindex = ' tabindex="0"';
    	}
    	
    	if ( isset( $args->container_class ) && 'main-nav' === $args->container_class ) {
    		foreach ( $item->classes as $value ) {
    			if ( 'menu_item_wpglobus_menu_switch' === $value ) {
    				$icon = generate_get_svg_icon( 'arrow' );
    				$title = $title . '<span role="' . $role . '" class="dropdown-menu-toggle"' . $tabindex . '>' . $icon . '</span>';
    			}
    		}
    	}
    	
    	return $title;
    }, 10, 4 );

    Let me know 馃檪

    #1048990
    Daniel G贸mez

    Hi,
    Now appear the arrow in menu, but in submenus too. The arrow appear next to the language names not in the end, but this is quite close to optimal result.
    Thanks!!

    #1048992
    Tom
    Lead Developer
    Lead Developer

    I just updated the function above – can you give it another shot?

    #1049007
    Daniel G贸mez

    Yes!

    #1049219
    Tom
    Lead Developer
    Lead Developer

    Working now? 馃檪

    #1049408
    Daniel G贸mez

    Yes, the function works fine, but the arrow icon appear hooked to the language name instead to separate. In mobile view is complicated press it.

    Thanks for you work!

    #1049843
    Tom
    Lead Developer
    Lead Developer

    Let’s try adding this:

    add_filter( 'nav_menu_css_class', function( $classes ) {
        if ( in_array( 'menu_item_wpglobus_menu_switch', $classes ) ) {
            $classes[] = 'menu-item-has-children';
        }
    
        return $classes;
    } );

    That might make it so the first function I shared is no longer necessary.

    Let me know 馃檪

    #1049931
    Daniel G贸mez

    Ohhh yeah! Perfect now!
    Thanks very much!!

    #1050193
    Tom
    Lead Developer
    Lead Developer

    You’re very welcome 馃檪

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.