Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #28491

    Marco B
    Participant

    Hi,
    I need to add a second menu where publishing the list of the categories under the top-menu. Is it possible? How can I do?
    regards

    #28500

    Silvia C
    Participant

    I’m interested in this too! A second horizontal menu beneath the navigation bar in the header would be sooo useful!
    Cheers
    Silvia

    #28739

    Alexander
    Keymaster

    Hi there,

    X Theme doesn’t have a built in way to add additional navigation here. If you’re interested in coding this feature yourself, I can provide a bit of direction.

    I would recommend changing the navbar template in this file: x/framework/views/global/_navbar.php

    If you’re going to be making code changes, I’d advise that you setup a child theme. You can find our collection here: http://theme.co/x/member/child-themes/ Or you can create your own with this information: http://codex.wordpress.org/Child_Themes A child theme allows you to make code changes that won’t be overwritten when an X update is released.

    I’d recommend reviewing the WordPress documentation on using menus in WordPress theme development. You can find this article here: http://codex.wordpress.org/Navigation_Menus

    There are two important steps here.

    1. Register the menu in your functions.php file. This gives you a new menu location to assign in Appearance > Menus. For this you would use .

    2. Edit the template to output the menu. For this you would use:

    #29917

    Marco B
    Participant

    Thanks so much, could you please repaste the links missed? Another question: in which file I have to place the code in order to publish the menu under the menu bar?

    #30151

    Support
    Member

    Hi Again,

    you will have to place the code in x/framework/views/global/_navbar.php file right below the following code

    wp_nav_menu( array(
                'theme_location' => 'primary',
                'container'      => false,
                'menu_class'     => 'x-nav sf-menu'
              ) );

    If you’re done registering the new menu in your functions.php file and assigning the new menu location at Appearance->Menus, you will just need to duplicate the above code and modify theme_location and menu_class to call your new menu(http://codex.wordpress.org/Function_Reference/wp_nav_menu). Then you can use some CSS to style the menu class you have defined.

    #55488

    Mohsan A
    Participant

    Thank you, I’ve succesfully added a new menu in the header. Could you please provide the Css to style it like the main menu? I’m using Renew stack (child theme)

    #55819

    Support
    Member

    Hey Mohsan,

    Happy to hear that you made it, congrats.

    To style it like the main menu, it would be easier to know which settings of Renew you are using(Renew 01, Renew 02, …) or share with us your website url. You can also try to open developer tools in chrome(command + i on a mac, control + i on a pc) and copy the menu related code(.x-nav, .x-navbar .x-nav>li, .x-navbar .x-nav>li>a).

    Cheers.

    #58263

    Mohsan A
    Participant
    This reply has been marked as private.
    #58654

    Rad
    Moderator

    Hi Mohsan,

    Placing that menu under header is not currently possible at your setup. You have place it under the slider in, please move it under the menu.

    There was a blue line at your slider, should I just give you css for X slider instead?

    Let me know.

    #58686

    Mohsan A
    Participant

    Actualy, I was hoping to add it just under the main nav menu to have two menus, that look the same, but are divided by a blue line.

    #58715

    Mohsan A
    Participant

    Figured it out, thank you very much for your help!

    #59148

    Support
    Member

    Hey Mohsan,

    Congratulation for fixing that on your own. We are happy we were able to help you.

    Cheers.