incorrect language menu displayed for non wordpress links
-
Hi,
I have 2 menus. They work correctly for wordpress pages/posts, however if I add the menu to non-wordpress page for some reason it selects incorrect language.
In addition, when I click to switch the language it takes me to the main page rather than the correct translation
web page: teyinet.az (menu is displayed incorrectly)
web page word press test page: https://teyinet.az/ru/%D1%82%D0%B5%D1%81%D1%82-%D0%BA%D0%B0%D0%BC%D0%BF%D0%B0%D0%BD%D0%B8%D0%B8-2/ ( you can switch language it works )Permalink Settings:
Post name > https://teyinet.az/sample-post/I have also added this code to set correct lang settings
add_filter(‘language_attributes’, ‘custom_lang_attr’);
function custom_lang_attr() {if(!(is_category() || is_archive() || is_single() || is_page())) {
$lang = explode(“/”,$_SERVER[‘REQUEST_URI’]);
if($lang[1] === ‘az’) {
return ‘lang=”az”‘;
}
return ‘lang=”ru”‘;
}
}
?>I would be grateful for any assistance…
Many thanks,
Mehti
- The topic ‘incorrect language menu displayed for non wordpress links’ is closed to new replies.