-
AuthorPosts
-
October 3, 2019 at 11:59 am #1144452
Hi,
I want to remove the Enfold’s language switcher from the top bar. I’ve added this to functions.php file :
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 );
remove_action( ‘avia_meta_header’, ‘avia_wpml_language_switch’, 10);
}Now the switcher in the top bar is gone, but it appears in the main menu…
How can I remove this switcher completely please ?
Best regards,
Stephanie
October 3, 2019 at 4:12 pm #1144519Hey lupistella,
Add this as well to quick css:
.avia_wpml_language_switch.avia_wpml_language_switch_extra{ display:none!important }
Best regards,
Jordan ShannonOctober 3, 2019 at 4:19 pm #1144522Sorry it doesn’t work, the switcher is still in the main menu
October 3, 2019 at 4:39 pm #1144543Hi,
Did you add the code to the very top of quick css so it runs first? Also, clear the cache a few times over.
Best regards,
Jordan ShannonOctober 3, 2019 at 4:48 pm #1144548I’ve removed the code I put in functions.php and it now works, thanks !
Another quick question if you don’t mind. I’ve added WPML’s switcher. It’s a dropdown list, but the dropdown arrow doesn’t show. WPML’s support said it doesn’t come from them but from the theme. I’ve switched to Twenty Seventeen theme and the arrow appears with no problem. So it definetly comes from Enfold. Any idea why ? Could it be an incompatibility with the font ?
October 7, 2019 at 3:34 am #1145597Hi,
Thank you for the update.
How did you enable the switcher exactly? You may need to add the default language switcher from WPML by using this snippet in the functions.php file.
add_action('avia_meta_header', 'ava_icl_language_selector'); function ava_icl_language_selector(){ do_action('icl_language_selector'); }
Best regards,
IsmaelOctober 7, 2019 at 11:43 am #1145726Hi Ismael,
I’ve enable the switcher through WPML settings (WPML > Languages > Menu language switcher).
I’ve tried your snippet. It messes up the language switcher and doesn’t add the arrow.
Regards,
StephanieOctober 9, 2019 at 7:03 am #1146399Hi,
Thank you for the update.
Can we access the site? Please post the login details in the private field, and make sure that the Appearance > Editor panel is accessible.
Best regards,
IsmaelOctober 10, 2019 at 8:58 am #1146781This reply has been marked as private.October 11, 2019 at 7:40 am #1147045Hi,
Thank you for the update.
The password for the username seems to be invalid. We also tried it without the hashtag at the beginning, but it still doesn’t work. And we got locked out of the site because we used it multiple times. Please check the info carefully. (see private field)
ERROR: Access from your IP address has been blocked for security reasons. Please contact the administrator.
Best regards,
IsmaelOctober 14, 2019 at 6:21 pm #1147882Hi Ismael,
This is weird. Please see below new login details.October 16, 2019 at 6:33 am #1148313Hi,
Thank you for the update.
We can now access the dashboard, and so we added the following css code to bring back the dropdown arrow in the language switcher.
#avia2-menu > li::after { font-family: 'dashicons'; content: "\f140"; }
Best regards,
IsmaelOctober 16, 2019 at 9:34 am #1148351Hi Ismael,
Thanks, but the result isn’t right :
– on Explorer : still no arrow
– on Chrome : no arrow + an extra horizontal switcher (just flags)
– on mobile : no arrow but a sort of round insteadBest regards,
StephanieOctober 17, 2019 at 2:39 am #1148745Hi,
Thank you for the update.
The icon font or the arrow displays fine on the developer version of Firefox. Do you have access to the .htaccess file? Adding this configuration should help fix the issue for other browsers.
<FilesMatch "\.(eot|otf|woff|ttf)$"> SetEnvIf Origin » "^http(s)?://(.+\.)?(domain1\.org|domain\.com)$" origin_is=$0 Header set Access-Control-Allow-Origin %{origin_is}e env=origin_is </FilesMatch>
Let us know how it goes.
Best regards,
IsmaelOctober 20, 2019 at 11:36 am #1149597Hi Ismael,
No, the arrow is not displayed correctly on Firefox either (it displays a square with little signs in it).
I’ve tried to add your code at the end of the .htaccess file, but it produced an error (the website became unaccessible).
Any solution please ?
Best regards,
StephanieOctober 23, 2019 at 5:05 am #1150365Hi,
Thank you for the update.
Did you copy the code from your email? Please copy it directly from the forum and make sure that the “domain1” and “domain” is replaced with the actual name of the site. Or post the FTP login details to the server so that we can edit the files when necessary.
Best regards,
IsmaelOctober 24, 2019 at 5:13 pm #1150950Hi Ismael,
I couldn’t make it work, I’m sorry.
Please see below my FTP credentials.
Best regards,
StephanieOctober 30, 2019 at 12:05 pm #1152278Hi,
Thank you for the update.
We replace the previous code with the following css modification. It replaces the icon font with an arrow-down symbol using css.
#avia2-menu > li::after { content: ""; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 3px solid #404040; top: 10px; position: relative; left: 5px; }
Best regards,
IsmaelOctober 31, 2019 at 12:09 am #1152561That’s great, thanks !!
October 31, 2019 at 12:11 am #1152563Hi,
Did you need additional help on this topic?
Best regards,
Jordan ShannonOctober 31, 2019 at 12:12 am #1152564This reply has been marked as private.October 31, 2019 at 12:12 am #1152565No it’s ok, thanks !
October 31, 2019 at 12:30 am #1152574Hi,
If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Remove language switcher’ is closed to new replies.