1. Home
  2. Docs
  3. Header (header.php)
  4. Language Selector
  5. Polylang Bilingual Scripts

Polylang Bilingual Scripts

<?php 
//get the active language
$getLang = pll_the_languages(array('raw'=>1));
$currLang = get_bloginfo('language');  
?>

description:
get the active language selected by user or auto selected by browser language

usage:
<?php if($currLang == “id-ID”){ echo”content in bahasa”; }else{ echo”content in english”; } ?>

Was this article helpful to you? Yes No

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *