Note: i will do some checks to see if this fits for me. This above mentioned ideas were inspired by this thread:
$languages = $sublanguage->get_languages() // return an array of WP_Post objectsĮcho $language->post_title // -> title of language (Ex: "English")Įcho $language->post_name // -> slug of language (Ex: "en")Įcho $language->post_content // -> locale code of language (Ex: "en_US")Įcho $sublanguage->get_translation_link($language) // -> language url for current page This will finally lead us to the following: e can use the for all languages via a global variable: the so called So if the site has got 3 different languages, we need 3 custom links like this. This custom link will then be replaced by actual language link in runtime. Guess: well i think it just creates and adds to menu a certain custom link with the name “language” and a empty url.
The question is: what does it do actually?įurthermore: Is it possible to get all languages via a global variable? “Add one of this for each of your languages”. What do you think? Love to hear from you. Well - what do you think!? does this fit the needs!? untill i reach the six different languages. 'secondary-menu','menu_class' => 'nav')) ?>Īnd so forth and so forth. Well i have mused alot bout the code: To add them to my site i should have to add the following to the WordPress template files (most likely my header.php and footer.php files). subsequently i should add six menus in the code above. 'secondary-menu' => _( 'Secondary Menu' )Ĭonclusio: so i think that ,i have to add alot - for the different languages i have - 6 different languages. Options By default the language switcher will display languages names only. 1.6 Add a language switcher anywhere You can include a language switcher anywhere in your site by using the PHP template tag pllthelanguages (). The 2 menus are the “Primary”, and “Secondary” menus. For example create a link > convert it to the language switcher. subsequently i should add six menus in the code below.Īpproach: could i do it like so: Add the following code to the functions.php file. for the different languages i have - 6 different languages. So i think that ,I want to add another menu. | | Item 1 | | Item 2 | | Item 3 || Item 4 | | Item 5 | | Language-switcher: de :: fr :: it ::es :: pt :: eng. french etc.spanish etc.italienįurthermore: to show the needs in another picture i add a second - here we see more things. I guess that a (language- )-switcher will be sufficient to arrrange this. like:Īgain since i only have a little amount of text which is allready translated completely i guess that i do not need a multilang system. Guess: i guess that this is possible – without using a multilang system eg. Idea: can i do this with a added (language- )switcher in the mega menu
What is aimed: i want to add all those texts in to the max-mega-menu: I have a defined text amount where which is allready translated. Note: the texts are allready translated – no need to do a runtime translation or something similar. In the menu the estimated textamount has got max 2000 words – in five languages: german, english french, spanish, italien While customizing the the theme according to my website needs, i found that the theme only supports one menu. i would like language- switcher in mega menu – without any ml-system - because i do not need ml-things.