Get Current Language Code Function/Method
-
Hi,
I have the following code in my front-page.php file
<section class="hero home"> <h1>Only show if selected language is EN</h1> <h1>Only show if selected language is DE</h1> </section>
I would like to have the correct heading shown on the page according to the selected language. Is there any function that retrieves the language code so that I can create a conditional if else statement? For ex, something like:
<section> <? if(get_language_code()=='EN'): ?> <h1>Only show if selected language is English</h1> <? elseif(get_language_code()=='DE'): ?> <h1>Only show if selected language is Deutsch</h1> <? endif; ?> </section>
I found this article and tried the suggested function but that doesn’t work for this plugin.
I can’t find an API so please help?
Regards,
Austin.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Get Current Language Code Function/Method’ is closed to new replies.