Display content based on current language with IF/ ELSE
-
Hello,
how can you display content based on the current language (on a bilingual website)?
I put this code from http://msls.co/ in my child theme’s functions.php:
function switcheroo() { $blog = MslsBlogCollection::instance()->get_current_blog(); $language = $blog->get_language(); }And this in my footer.php:
<?php if( switcheroo() == 'de_DE' ){ ?> <!-- German content here--> German content <?php }else { ?> <!-- English content here--> English content <?php }?>My ELSE rule works, but not the IF rule.
I guess the solution must be really obvious, but I’m a PHP newb, so I just don’t see it.Any help is appreciated.
Thanks in advance.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Display content based on current language with IF/ ELSE’ is closed to new replies.