WPML – ICL_LANGUAGE_CODE breaks my template

Using IF conditional with WPML should be easy but for some reason my template stops working as soon as i place following code in footer.php or everywhere else

<?php 
 if (ICL_LANGUAGE_CODE == 'en') {
     //english here
 } else {
     //other languages
 }
?>

Am I missing something?

Related posts

Leave a Reply

1 comment

  1. <?php if (ICL_LANGUAGE_CODE == 'en'): ?>
        <!-- english here -->
    <?php elseif (ICL_LANGUAGE_CODE == 'es'): ?>
        <!-- spanish here -->
    <?php endif; ?>
    <!-- ======== Or ======= -->
    <?php if (ICL_LANGUAGE_CODE == 'en'): ?>
        <!-- english here -->
    <?php else: ?>
        <!-- spanish here -->
    <?php endif; ?>