Answer the question
In order to leave comments, you need to log in
How to change header and footer when changing language using Polylang plugin in WordPress?
Good afternoon!
I am developing a site on Wordpress - the template is also my own with a developed design. The site must be in three languages - Russian, English and Arabic. I am using the Polylang plugin.
It seems that everything turned out as we wanted, except for the header and footer . If it's not difficult, please tell me where to dig ..?
I beg you, do not push aside "go learn php". I teach, I try, I make mistakes, I correct them and I teach again...
But there are moments from which many have learned and also made mistakes. And I think they also asked for help ....
Thank you in advance for your help !!!
Answer the question
In order to leave comments, you need to log in
Kind.
It didn't work with the plugin, but judging by the documentation , it has the pll_current_language function to determine the current language. Therefore, add conditions to header.php and footer.php and change as needed.
if(pll_current_language() == 'ru') {
//code
} else if(pll_current_language() == 'en') {
//code
}
var_dump(pll_current_language());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question