This topic contains 5 replies, has 2 voices, and was last updated by xiligroup dev 11 years, 10 months ago.
You must be logged in to reply to this topic.
dev.xiligroup est en travaux › Forums › xili-language plugin › secondary menu translation
Tagged: free version, menu, theme
This topic contains 5 replies, has 2 voices, and was last updated by xiligroup dev 11 years, 10 months ago.
what is your current theme ?
I’m using your 2012 child theme.
Also I noticed that on the ‘xili options’ admin page, the « Enable (or not) language instantiation for these registered menus » doesn’t work. No matter what combination of checkboxes I check, nothing changes. I have 2 checkboxes, ‘primary’ and ‘secondary.
Thanks
Currently 2012 registers only one menu location (see functions.php). And the free child example is ready to clone this ‘primary’ only…
Even if the xili-options detects that you have add one (secondary)… the default cloning function « clones » the first one…
If you are php wp developer, it will be easy to improve this example…
Apologize but free version offers limited features…
If you need xili-language premium services, tell me via form at https://dev.xiligroup.com/?page_id=2436
M.
Thanks for your help. I managed to figure it out 🙂 If anyone else has this problem, all you need to do is find the function ‘xili_create_menu_locations’ in the child theme’s functions.php. Then just loop through the available menu locations before looping through the languages.
Or, you can just paste the following after the existing foreach loop.
$twoloc = $menu_locations_keys[1]; // primary
foreach ( $language_slugs_list as $slug ) {
$two_menu_location = $twoloc.'_'.$slug ;
if ( $slug != $default ) {
register_nav_menu ( $two_menu_location, sprintf( __('%s for %s','twentytwelve'), $menu_locations[$twoloc], $slug ) );
}
}
Note that for a third menu location, you’d just copy this again and edit as necessary. Hope this helps
Excellent ! You can also make a loop with each $menu_locations_keys – so the code become more versatile !
You must be logged in to reply to this topic.
Ce site utilise des cookies afin que nous puissions vous fournir la meilleure expérience utilisateur possible. Les informations sur les cookies sont stockées dans votre navigateur et remplissent des fonctions telles que vous reconnaître lorsque vous revenez sur notre site Web et aider notre équipe à comprendre les sections du site que vous trouvez les plus intéressantes et utiles.
Cette option doit être activée à tout moment afin que nous puissions enregistrer vos préférences pour les réglages de cookie.
Si vous désactivez ce cookie, nous ne pourrons pas enregistrer vos préférences. Cela signifie que chaque fois que vous visitez ce site, vous devrez activer ou désactiver à nouveau les cookies.