Tagged: ismael, wpml language switcher
-
AuthorPosts
-
April 25, 2017 at 1:48 pm #782871
Hi,
once WMPL is activated, the language switcher is placed in the header. WPML suggests to put <?php do_action(‘icl_language_selector’); ?> into the theme. I tried that by putting the line into child-theme//includes/helper-main-menu.phpI would like to place the language switcher between two icons in the header not using the secondary menu but something seems to override the position of the switcher.
In detail my plan is to modify the helper-main-menu.php as follows:
after
$output .= “<div class=’container av-logo-container’>”;
$output .= “<div class=’inner-container’>”;I would like to include the switcher in a div
$output .= “<div id=’custom’>”;
$output .= ““;
language switcher should be placed here
$output .= ““;
$output .= “</div>”;Can you advice how to achieve that.
Man thanksApril 28, 2017 at 11:57 am #784461Hey schmu2013,
Would you mind providing a precise link to your site, showing the elements in question? We need to be able to inspect them in order to help :)
Best regards,
AndyApril 28, 2017 at 12:07 pm #784467Hi Andy,
thanks for your reply. Sent you a private note.
Tks.May 1, 2017 at 8:11 am #785575Hi,
Please refer to this link for a possible solution.
// https://kriesi.at/support/topic/wpml-language-selector-text-instead-of-flag-on-top-bar/#post-749203
Best regards,
IsmaelMay 3, 2017 at 2:27 pm #787147Hi Ismael,
followed the instructions on the post. Enfold has been updated to the latest version. I can place the language switcher flexibel in posts / pages, but it does not work in the header.Sent you details by PN
ThanksMay 4, 2017 at 5:09 am #787574Hi,
You need to remove the previous modification before applying the filters suggested in the previous thread. Could you please provide a screenshot of the exact location where you want to put the language switcher?
Best regards,
IsmaelMay 4, 2017 at 10:35 am #787687Hi,
do you mean that I need to change back to the original Enfold code => save => copy paste the modifications => save…
ThanksMay 4, 2017 at 10:54 pm #788116Hi,
Yes please, follow the steps as Ismael suggested and let us know.
Thank you very much
Best regards,
BasilisJune 13, 2017 at 11:39 am #807379Hi,
sorry for my late reply due to vacations..I followed all the steps suggested but the language switcher sticks to the upper left corner. I tried to place it within the “inner-container” through adding this code in the child helper-main-menu.php:
$output .= "<div class='inner-container'>"; $output .= "<div id='switch'>"; do_action('wpml_add_language_selector'); $output .= "</div>";
This does not work. Can you help pls. The desired location of the language switcher is above the main menu but not in a second top bar menu.
Many thanks.June 14, 2017 at 9:22 am #807859Hi,
Please don’t modify the helper-main-menu.php, just add the filter in the 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', 9998, 2 ); remove_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 9998, 2 ); remove_action( 'avia_meta_header', 'avia_wpml_language_switch', 10); } add_action('ava_main_header', 'add_custom_content_to_header'); function add_custom_content_to_header() { do_action('icl_language_selector'); }
Adjust the position of the switcher using css.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.