1

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?

Ahmed Siouani
  • 13,701
  • 12
  • 61
  • 72
user3140179
  • 11
  • 1
  • 2
  • I've just tested your code and can see absolutely no issue. I tested with the plugin both on and off with no issues. Can you post more of the footer code with the if statement. Also try putting this in the header `error_reporting(E_ALL);` to show any errors that are occurring. – The Humble Rat Dec 27 '13 at 18:27
  • 1
    Sry for wasting your time, i found my 'bug' has nothing to do with WPML or WP. The code works fine, i just wasted about 5 hours of my life because of filezilla which started uploading corrupted files :( – user3140179 Dec 27 '13 at 18:39
  • Happens to the best of us. – The Humble Rat Dec 27 '13 at 18:40

1 Answers1

2
<?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; ?>