• Resolved bluedrag

    (@bluedrag)


    I have a slideshow I am display on my side with PHP code in the template. I’d like to swap out the slideshow based on which language is active. Is there any way to do this with polylang? For example:

    
    if (lang == 'en') {
      echo english-slideshow;
    } else if (lang == 'fr') {
      echo french-slideshow;
    }
    
Viewing 1 replies (of 1 total)
  • Thread Starter bluedrag

    (@bluedrag)

    I was able to solve this issue with the following code:

    
       	<?php 
                    if(pll_current_language() == 'en') {
                        echo 'Only in english';
                    } else if(pll_current_language() == 'fr') {
                        echo echo 'Seulment en francais'; 
                    }  
            ?>
    
Viewing 1 replies (of 1 total)
  • The topic ‘Conditionally display code based on active language in template’ is closed to new replies.