ThemeShaper Forums » Thematic

[closed]

How to add a second WP 3.x menu?

(5 posts)
  • Started 3 years ago by neonbible
  • Latest reply from AnotherAndrew
  • This topic is resolved

Tags:

  1. neonbible
    Member

    When I go to Menus section in the admin conole it says "Your theme supports 1 menu". I do I get Thematic to support 2? And how do I position them?

    E.g. I want first menu to be on top of the header, and second below.

    Thanks

    Posted 3 years ago #
  2. neonbible
    Member

    Ah thanks. Been a while since I've visited this forum and completely forgotten about that excellent thread! Thanks.

    Do you how to put this new menu at the top of the branding div?

    Posted 3 years ago #
  3. the process isnt any different. the destination hook is the only thing that changes. my example has you putting the 2nd menu above the header with:

    add_action('thematic_aboveheader','top_menu');

    you just need to add it to a different hook

    add_action('thematic_header','top_menu',2);

    would put it just inside the branding open

    visual layouts of thematic hooks
    www.bluemandala.com/thematic/thematic-structure.html
    http://visualizing.thematic4you.com/

    Posted 3 years ago #
  4. AnotherAndrew
    Member

    Try this, paste this into your functions file, and then visit the menu page to edit and add pages or categories:

    // Add additional menus
    // Register the new menus
    function register_my_menus() {
    register_nav_menus(
    array(
    'primary-menu' => __( 'Primary Menu' ),
    'top-menu' => __( 'Top Menu' ),

    )
    );
    }
    add_action( 'init', 'register_my_menus' );

    ///Top Menu (optional)
    function top_menu() {

    if ( has_nav_menu( 'top-menu' ) ) {
    wp_nav_menu( array( 'theme_location' => 'top-menu',
    'container_id'=>'top-menu',
    'container_class' => 'clearfix ',
    'menu_class' => 'sf-menu', // we assign the sf-menu class to the menu ul so that superfish works on this menu too
    ) );

    }
    }

    add_action('thematic_aboveheader','top_menu');

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.