Support » Plugin: MultilingualPress » Get Language in Theme/Templates

  • Resolved tobias-r



    I installed the plugin and everything works just fine.

    However I couldn’t find a documentation and I was wondering how I can change text in the template depending on the language.

    My idea would be simple but stupid

    if($lang = "en") echo "hello";
    else echo "salut";

    What I would need here is a way to this, to get the language
    Thanks for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Fuxia


    You could use get_bloginfo( 'language' ).

    if ( 'en' === get_bloginfo( 'language' ) )
        echo 'hello';
        echo 'salut';

    But that’s not how you should change strings. Use proper translation functions instead and a language file.

    Hi, only gotta change a few string.

    Your code is not working for me.

    get_bloginfo always return “en-US”.

    I am using multiple Networks and Multilingual Press. The only place I find to select languages is in this plugin. Nothing under settings > general or other places.

    Any help?

    Plugin Author Fuxia


    If you don’t find the settings under General Settings, you have to install the correct language first from

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get Language in Theme/Templates’ is closed to new replies.