Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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.php

    I 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 thanks

    #784461

    Hey 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,
    Andy

    #784467

    Hi Andy,
    thanks for your reply. Sent you a private note.
    Tks.

    #785575

    Hi,

    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,
    Ismael

    #787147

    Hi 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
    Thanks

    #787574

    Hi,

    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,
    Ismael

    #787687

    Hi,
    do you mean that I need to change back to the original Enfold code => save => copy paste the modifications => save…
    Thanks

    #788116

    Hi,

    Yes please, follow the steps as Ismael suggested and let us know.

    Thank you very much

    Best regards,
    Basilis

    #807379

    Hi,
    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.

    #807859

    Hi,

    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

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