This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Secondary Menu

Open 1 reply themetheme-vantage
10 years ago · Last reply by Andrew Misplon 10 years ago

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

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

1
  1. Andrew Misplon Staff 10 years, 4 months ago

    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.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread