WordPress.org

Ready to get started?Download WordPress

Forums

Can I have two different main menus on one site? (11 posts)

  1. slj1111
    Member
    Posted 2 months ago #

    Hope someone can help. I've searched through other support tickets for this issue and have spent a few hours trying to implement different solutions but it's just not working for me.

    I have one site with a few pages in French. For those few pages I'd like the main menu to be French too. I've created two menus: "main" and "french".

    I've looked at different solutions but am fairly confused about the best way to approach this. I understand I have to register the two menus, but in which functions.php file - the one in the wp-includes folder or the one in the theme folder?

    Also, I've seen solutions that suggest additional code goes in the header.php or the page template file. Which is the best one? Which is the best code to edit and add?

    Appreciate any help!

  2. esmi
    Forum Moderator
    Posted 2 months ago #

    the one in the wp-includes folder or the one in the theme folder?

    The one in your theme's folder. You should never, ever, edit core WordPress files. What theme are you using? Where did you download it from?

  3. slj1111
    Member
    Posted 2 months ago #

    I'm using the Modernize theme from Themeforest:

    http://themeforest.net/item/modernize-flexibility-of-wordpress/1264247

    Thanks for clarifying about the core WordPress files, that's a start :)

  4. esmi
    Forum Moderator
    Posted 2 months ago #

    I'm sorry but as you are using a commercial theme, you need to seek support from the theme's developer/vendor. We do not have access to, nor do we support, commercial products here. However, this codex section might give you some ideas.

  5. Spyro webz
    Member
    Posted 2 months ago #

    hello,

    for crate a menu you need to add in your theme function.php

    like
    <?php register_nav_menu( 'secondary', __( 'second Menu', 'your theme name' ) );?>

    where you want to show it put the following code there

    like

    <?php wp_nav_menu( array( 'theme_location' => 'secondary', 'menu_class' => 'your menu class' ) ); ?>

    and that's it.

  6. slj1111
    Member
    Posted 2 months ago #

    thanks Spyro. I'm not sure though what you mean about "where you want to show it put the following code there" - what file? And what bits of the code do I edit?

  7. esmi
    Forum Moderator
    Posted 2 months ago #

    See the section at the second link I posted above.

  8. slj1111
    Member
    Posted 2 months ago #

    thanks Esmi, the theme developer says they don't support my question and sent me here. So I guess I'm stuck unless someone else can help.

  9. esmi
    Forum Moderator
    Posted 2 months ago #

    See the section at the second link I posted above.

  10. slj1111
    Member
    Posted 2 months ago #

    I did, but it's for logged in vs not logged in users, we don't have that. I will muddle around some more.

  11. Spyro webz
    Member
    Posted 2 months ago #

    where you want to show your second menu

    for example in footer?
    in header or what ever.

    put this code there

    <?php wp_nav_menu( array( 'theme_location' => 'secondary', 'menu_class' => 'your menu class' ) ); ?>

    it will show your secondary menu

Reply

You must log in to post.

About this Topic

Tags