Title: Switch language manually : PHP ?
Last modified: August 21, 2016

---

# Switch language manually : PHP ?

 *  Resolved [Damien](https://wordpress.org/support/users/damien12/)
 * (@damien12)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/switch-language-manually-php/)
 * Hello,
 * Great plugin, I’m using it for several websites and works perfectly well, thank
   you!
 * However, I would like to insert the content of a page into another page and according
   to the language chosen it would insert the right page.
 * I tried something like :
    <?php if($_SESSION[‘lang’] == “en”){ echo “my content
   en”; } else if($_SESSION[‘lang’] == “es”){ echo “my content es”; } ?>
 * but it doesn’t work! I can’t find a solution for this, I guess Polylang uses 
   another system. Could you tell me how to do? Would be great!
 * Thank you very much,
 * Damien
 * [https://wordpress.org/plugins/polylang/](https://wordpress.org/plugins/polylang/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [xhal44](https://wordpress.org/support/users/xhal44/)
 * (@xhal44)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/switch-language-manually-php/#post-4756999)
 * Try using `pll_current_language();` to check the active language.
 *  Thread Starter [Damien](https://wordpress.org/support/users/damien12/)
 * (@damien12)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/switch-language-manually-php/#post-4757041)
 * Thank you very much, I didn’t even think about using it ! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Switch language manually : PHP ?’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Damien](https://wordpress.org/support/users/damien12/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/switch-language-manually-php/#post-4757041)
 * Status: resolved