Answer the question
In order to leave comments, you need to log in
How to show in polylang part of the html code in one language and another part of the code in another?
Hello. Tell me please. I'm looking on the Internet, I can't find it.
Answer the question
In order to leave comments, you need to log in
The logic of the task is very simple:
1. Determine the current language
2. Check the match of the current language
3. Depending on the match, display the code
For example, if the site has English and Russian:
$en_lang = 'en';
$ru_lang = 'ru';
$curr_lang = pll_current_language();
if ( $curr_lang == $en_lang ) {
// для англ версии
} elseif ( $curr_lang == $ru_lang ) {
// для русской
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question