Get language code of WPML

I’m trying to get the language code of the WPLM wordpress plugin. This is how I’m doing it without luck:

<?php if (ICL_LANGUAGE_CODE == 'es_En') { ?>
    <p>Spanish text</p>
<?php> ?>

Any idea where is the problem? I have check some tutorials and they do this way.

Related posts

Leave a Reply

2 comments

  1. es_En isn’t a valid language code. You’ll want to just use es:

    <?php if (ICL_LANGUAGE_CODE == 'es'): ?>
        <p>Spanish text</p>
    <?php endif; ?>