- This topic has 11 replies, 2 voices, and was last updated 6 years, 5 months ago by
Tom.
-
AuthorPosts
-
October 29, 2019 at 3:58 pm #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.October 29, 2019 at 7:36 pm #1048378Tom
Lead DeveloperLead DeveloperHi 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 馃檪
October 30, 2019 at 1:36 am #1048499Daniel G贸mez
I don’t use any function to remove the arrows. Only I install and configure the plugin normally, without extras functions.
Thanks!October 30, 2019 at 8:58 am #1048967Tom
Lead DeveloperLead DeveloperHi 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 馃檪
October 30, 2019 at 9:14 am #1048990Daniel 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!!October 30, 2019 at 9:17 am #1048992Tom
Lead DeveloperLead DeveloperI just updated the function above – can you give it another shot?
October 30, 2019 at 9:32 am #1049007Daniel G贸mez
Yes!
October 30, 2019 at 3:47 pm #1049219Tom
Lead DeveloperLead DeveloperWorking now? 馃檪
October 31, 2019 at 1:36 am #1049408Daniel 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!
October 31, 2019 at 9:49 am #1049843Tom
Lead DeveloperLead DeveloperLet’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 馃檪
October 31, 2019 at 12:16 pm #1049931Daniel G贸mez
Ohhh yeah! Perfect now!
Thanks very much!!October 31, 2019 at 8:44 pm #1050193Tom
Lead DeveloperLead DeveloperYou’re very welcome 馃檪
-
AuthorPosts
- You must be logged in to reply to this topic.