Hello
I am using vantage free, I have built a site for an association, main pages are in French, main/primary menu is in French,
I have added an English section, and have duplicate the French pages, translated them and they are now the English pages on my site,
My only problem is the main menu is in French on the English pages too
I have created a secondary menu, in English, which links to the English pages,
I have added the following to functions. php, in my folder “vantage-child” theme,
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
‘primary’ => __( ‘Primary Menu’, ‘vantage-child’ ),
‘secondary’ =>__( ‘Secondary Menu’, ‘vantage-child’ ),
) );
Just with the code above, it did not do anything, I still do not know how to display the secondary menu, and replace the primary one on some pages with secondary
As I only want this secondary menu on my English pages, I thought about also adding to the functions.php (in my vantage-child theme folder), the code:
function show_menu() {
if ( is_page(‘not_yet’) )
{
if ( has_nav_menu( ‘secondary’ ) )
{ wp_nav_menu( array( ‘vantage-child’ => ‘secondary’ ) ); }
}
}
Ok, all that to say, it does not work, and only display the primary menu (which is in French) on all my pages,
I would like to avoid using a plugin, I want to learn how to do this,
Thanks
Hi stef
I know it’s quite late in your build but have you considered using Polyang for your site?
https://wordpress.org/plugins/polylang/
That’ll handle your translation and menu functions.