If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #23672

    Hello I am using Enfold with large fixed menu and social icons. Is there a way to add the language switcher flag to the right of the head section?



    Edit header.php then find this code


    Below, place this code


    Then add this on your custom.css

    #lang_sel a {
    border: none;

    #lang_sel {
    right: -60px;
    top: -10px;

    #lang_sel a.lang_sel_sel {
    background: url(../img/nav-arrow-down.png)right no-repeat;
    color: #444;

    Change the top and right properties to position the switcher.




    If you just like to embed the flag icons, you may need to follow these steps:

    Open functions.php, locate in line 362

    add_theme_support( 'avia_post_meta_compat');

    Below add:

    * F1 add: Language selector (flags) function for header (right menu)
    function header_lang_flags(){
    $languages = icl_get_languages('skip_missing=0&orderby=code');
    echo '<ul>';
    foreach($languages as $l){
    echo '<li>';
    if(!$l['active']) echo '<a href="'.$l['url'].'">';
    echo '<img src="'.$l['country_flag_url'].'" alt="'.$l['native_name'].'" title="'.$l['native_name'].'" />';
    if(!$l['active']) echo '</a>';
    echo '</li>';
    echo '</ul>';

    Then open up header.php, locate on line 113:


    Add below:


    Have fun.



    formateins – thanks for the hint :)

    Best regards,



    NP! :)

    PS: You should put all your codestuff to an extra file (name it like functions-my.php). Put your functions to it and just add require_once(“functions-my.php”); to the functions.php.

    This saves some time, if Kriesi updates the theme. It’s probably easier and quicker than building a child theme. :)

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘WPML Language switcher in header?’ is closed to new replies.