SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    727
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    wrong menus display on page.

    I created two menus
    but when I call the main menu I get the other one.
    I am using this in the header.php to call the main menu
    Code:
    <?php wp_nav_menu( array( 'top_nav' => 'topNav' ) ); ?>
    but get the menu for engineering
    and I use this
    Code:
    wp_nav_menu( array( 'eng_nav' => 'engNav', 'container_class' => 'container' ) );
    in an entirely diff page but this one is showing up as the top menu in the main page (thebigmeow.us)
    so far the menu that works is the one that has the original html next to the search box.

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,801
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    It has been a while since I done WP. but your first argument is invalid. I think it should be : <?php wp_nav_menu( array( 'menu' => 'topNav' ) ); ?>
    if you wished to give the menu UL an ID of 'topNav' then you will need the additional argument of 'menu_id'=>'topNav' if you wanted the ID on the wrapper element and not the UL then you'd use 'container_id' => 'topNav'.

    always checked the WP codex. http://codex.wordpress.org/Function_...ce/wp_nav_menu


    Speaking of, WP forum experts feel free to correct me if I missed my mark.

  3. #3
    SitePoint Addict
    Join Date
    Oct 2008
    Location
    Virtual World is my location
    Posts
    311
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Yes I agree with @dresden_phoenix. It should be
    <?php wp_nav_menu( array( 'menu' => 'topNav' ) ); ?>
    as mentioned and not
    <?php wp_nav_menu( array( 'top_nav' => 'topNav' ) ); ?>
    that you have coded.
    RecipesNext.com - recipes, kitchen queries, videos & more...
    BargainNext.com - coupons / deals / bargains / offers & more...

  4. #4
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    727
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    finally got to try this & think it worked. thank you!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •