Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #309049

    Hi!
    I have my site translated with WPML. The language flags are automatically added to the topmenu if i use a topmenu. This is not mobile friendly to have them there and i can’t find a solution to disable them from WPML settings, and not from Enfold theme settings.
    I want to place them somewhere else, in my first color section on startpage and in the socket.

    To do that i need to add this code in functions.php:

    function language_selector_flags(){
        $languages = icl_get_languages('skip_missing=0&orderby=code');
        if(!empty($languages)){
            foreach($languages as $l){
                if(!$l['active']) echo '<a href="'.$l['url'].'">';
                echo '<img src="'.$l['country_flag_url'].'" height="12" alt="'.$l['language_code'].'" width="18" />';
                if(!$l['active']) echo '</a>';
            }
        }
    }

    and this in a textblock and socket:
    <div id="flags_language_selector"><?php language_selector_flags(); ?></div >

    But where do i find the file with the socket file and the right place?
    I do also need this code in Quick CSS:

    #flags_language_selector img{
          margin:1px;
          border:1px solid #333;
    }

    So my problem is how to disable the flags from topmenu and where to find that socket file and the right place?

    Regards, Charlie

    #309319

    Hey Charlie999!

    Can you post the link to your website please?
    Please go to Appearance > Editor and open Footer.php file and search for id="socket" and add your code right below it

    Cheers!
    Yigit

    #309498

    Hello!
    Thanks for the response. I actually found a way to disable the language flags from the top menu.

    .avia_wpml_language_switch li .language_flag{
    display:none;
    }
    

    Now i just have try to put them somewhere else (under my slider in a textblock and perhaps centered in the socket)
    I just hope that my code don’t make the flags invisible everywhere.

    Thanks for a really good theme guys!

    #309517

    Hi!

    Please change your code to following one

    #header_meta .avia_wpml_language_switch li .language_flag{ display:none; }

    So it should only remove the one on the header and not globally

    Cheers!
    Yigit

    #309715

    Hi
    This works fine on my default language, the flags are away from the topmenu and i’m able to have the flags in the socket instead.
    But i run in to a new problem, when changing the language to other languages from the frontpage, the flags are back in the topmenu.

    Now i know that i have to paste in that code to Quick CSS also in Enfold English Theme Options (like all other languages). But the big problem is that i can’t open the English theme options pages, the link just not work, so i’m not able to manage any other Theme Options than the default language.

    Why do we have to manage the Theme options for all used languages at all? Is there any good reason for that behavior that i cant figure out?
    For me it seems like a bad behavior, because it just give us more work, why do we need different rules for each language if we use several languages? Why not only one Theme Options once for all?

    Friendly Regards, Charlie

    #309721

    Hi again!
    As usual with my questions i found a solution later on. There was two ways to solve my problem with customized css for the languages.
    The first was to use the custom.css file and the second was that i was finally able to open the Theme Options for the other languages too. The link do not work from the left menu in the Enfold Options, but it does work from the topmenu (the one with a black background) which appears when an admin is logged in.

    Cheers!

    #309850

    Hey!

    Glad you figured it out! Let us know if you have any other questions or issues

    Best regards,
    Yigit

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Disable language flags from topmenu’ is closed to new replies.