-
AuthorPosts
-
March 21, 2014 at 3:41 pm #241220
Hi guys,
after installing the latest update Version 2.6.2, the WPML flags are showing up twice in my main menu.
Here`s my site:March 22, 2014 at 11:34 am #241574Hi ChrisiRa!
Since 2.6.2 Enfold will add the flags to the main menu if WPML is activated and no top bar (secondary menu) is activated.
You’ve two options:1) Go to WPML > Languages and deselect the ” Display the language switcher in the WP Menu” checkbox. This will deactivate the default menu language switcher.
or
2) If you don’t want to show the theme language switcher in the main menu insert this code into your child theme:
add_action('after_setup_theme','avia_remove_main_menu_flags'); function avia_remove_main_menu_flags(){ remove_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 20, 2 ); remove_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 20, 2 ); }
Cheers!
PeterMarch 25, 2014 at 8:36 pm #242974Hi, also can’t get rid of those flags; please see our site
tried your instructions but they are still showing up??
March 25, 2014 at 10:45 pm #243021Hi!
Please add following code to Quick CSS in Enfold theme options under Styling tab
.language_en, .language_es, .language_fr { display: none; }
Regards,
YigitMarch 26, 2014 at 6:46 pm #243475Sorry but maybe I am being a novice but I didnt know I had a child theme and it doesnt say where to add the code to the child theme, can I please get a little more explicit instructions.
March 27, 2014 at 12:30 pm #243783Hey!
Thank you for using the theme! You can add Yigit’s code at the very bottom of the child theme’s style.css. Reload the page a few times to see the changes.
Regards,
IsmaelMarch 27, 2014 at 12:38 pm #243788I think if you read the whole thread Yigit was suggesting I use this code
add_action(‘after_setup_theme’,’avia_remove_main_menu_flags’);
function avia_remove_main_menu_flags(){
remove_filter( ‘wp_nav_menu_items’, ‘avia_append_lang_flags’, 20, 2 );
remove_filter( ‘avf_fallback_menu_items’, ‘avia_append_lang_flags’, 20, 2 );
}This code doesnt look like CSS to me? but if I put it in style.css you think this will work?
March 27, 2014 at 4:44 pm #243900Hey!
You should add that code Peter posted inside Functions.php file if you don’t want to show the theme language switcher in the main menu
Cheers!
YigitMarch 27, 2014 at 5:19 pm #243933So if I put this in functions.php I get a syntax error anc you please sned me the functions.php as you think it should be?
March 30, 2014 at 11:03 am #245042Hey!
Please use the code I posted here: https://kriesi.at/support/topic/wpml-language-switcher-flags/#post-241574 and place it at the very bottom of the enfold/funcions.php file or into your child theme functions.php file.
Regards,
PeterApril 1, 2014 at 6:59 pm #246204I think we must be at cross purposes I want to show the language changer as a drop down list in the menu, but it shows it as a list of flags, I have changed the code in functions as you suggested and http://www.preventon.com/home still shows a string of flags.. please can you advise…
April 3, 2014 at 8:23 am #246916Hey!
The code should be working. Please create me an admin account and I’ll look into it. Alternatively you can modify wp-content/themes/enfold/config-wpml/config.php and delete:
//first append search item to main menu add_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 20, 2 ); add_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 20, 2 );
Then the theme won’t append the flags to the menu.
Regards,
Peter -
AuthorPosts
- You must be logged in to reply to this topic.