adding a content (language) switcher to the menu –
-
dear community,
I am developing a site in WordPress. I am using the twentyseventeen-theme. i would like language-[content-] switcher in mega menu – without any ml-system – because i do not need ml-things. While customizing the the theme according to my website needs, i found that the theme only supports one menu. I want to add another menu.
at the moment the site has
– Max-Mega-Menü
– etc. etxin the menu the estimated textamount has got max 2000 words – in five languages: german, english; french, spanish, italien
note: the texts are allready translated – no need to do a runtime translation or something similar. I have a defined text amount where which is allready translated.what is aimed: i want to add all those texts in to the max-mega-menu:
idea: can i do this with a added (language-[content] )switcher in the mega menu
guess: i guess that this is possible – without using a multilang system eg. like:-WPML
-Polylang
-Weglot
-TranslatePressagain; since i only have a little amount of text which is allready translated completely i guess that i do not need a multilang system. I guess that a (language- [content])-switcher will be sufficient to arrrange this.
What do you think? Love to hear from you.
see the example:
----------------------- | switcher of content | ----------------------- | | /|\ --------- --------- ---------- --------- --------- |german |-------< | engl. |>-------|french. |>------|span. |>---------|italien.| --------- --------- ---------- --------- --------- \|/ | | ------------ |Lorem ipsum| etc. eng. etc. french etc.spanish etc.italien ------------ \|/ | | --------- | blabla | ---------
furthermore: to show the needs in another picture i add a second – here we see more things …
see the structure of the page…language-switcher: de :: fr :: it ::es :: pt :: eng :: ...--+ | | +-----------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------+ | | | +-------------------+ +------------------+ +----------------------------------+ +-------------------+ | | | | | | | || | | | | | | Item 1 | | Item 2 | | Item 3 || Item 4 | | Item 5 | | | | | | | | || | | | | | | | | | | || | | | | | | | | | | || | | | | | +-------------------+ +------------------+ +----------------------------------+ +-------------------+ | | | | | | | | | | | | | | | +--------------------------------------------------------------------------------------------------------------+
so i think that ,,,,I want to add another menu…. for the different languages i have – 6 different languages: …. subsequently i should add six menus in the code below…
approach: could i do it like so: Add the following code to the functions.php file. The 2 menus are the “Primary”, and “Secondary” menus.
//Register Navigations add_action( 'init', 'my_custom_menus' ); function my_custom_menus() { register_nav_menus( array( 'primary-menu' => __( 'Primary Menu' ), 'secondary-menu' => __( 'Secondary Menu' ) ) ); }
conclusio: so i think that ,,,,i have to add alot – for the different languages i have – 6 different languages: …. subsequently i should add six menus in the code above…
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).
<?php wp_nav_menu (array('theme_location' => 'primary-menu','menu_class' => 'nav'));?> <?php wp_nav_menu (array('theme_location' => 'secondary-menu','menu_class' => 'nav'));?>
and so forth and so forth… untill i reach the six different languages..
Well – what do you think!? does this fit the needs!?
What do you think? Love to hear from you.
- The topic ‘adding a content (language) switcher to the menu –’ is closed to new replies.