SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpress Custom Menu Help

    Hi guys,
    I wonder if you can help? I am trying to build a website using the new word press 3.6 and I am using a blank theme to create it in which I took and learnt from Lynda.com. Now I have created a few websites in the past using the theme but for some reason I am having problem creating a custom menu using menus under the appearance tab.
    The steps that I usually take are

    1, To add this code in the function file of the wordpress theme

    if (function_exists('register_nav_munu')) {
    register_nav_munu(
    array(
    'main_nav' => 'Main Navigation Menu'
    )
    );
    }
    2, My next step is to create a ‘menu name’ in menus under appearance in wordpress and then add the menus .

    3, my next step is to add this code in the wordpress template and put in the name of the menu that i created.

    <?php wp_nav_menu(array('menu' => 'Main Nav Menu')); ?>

    But for some reason its not working for me and i have ran out ideas,
    so has anyone got any ideas, of what i have done wrong or better ideas of how i can solve the mystery?

    Thanks in advanced

    Anthony

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2013
    Posts
    34
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Try this one
    Code:
    <?php wp_nav_menu( array( 'theme_location' => 'Main Navigation Menu' ) ); ?>

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadir41 View Post
    Try this one
    Code:
    <?php wp_nav_menu( array( 'theme_location' => 'Main Navigation Menu' ) ); ?>
    I tried that but for some reason did not work, however i tried <?php wp_nav_menu(); ?> and it works

    but my only problem now is that no styling is getting to it. The menu's just show in a list coloured in blue, with underlines.

    I have it wrapped in a </nav></nav> tag buts it still doesnt work, I have also tried it without and still the same result.

  4. #4
    SitePoint Evangelist WebMachine's Avatar
    Join Date
    Jun 2007
    Location
    Ontario, Canada
    Posts
    411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What css styling have you added to your stylesheet that you want for this menu?

  5. #5
    SitePoint Enthusiast
    Join Date
    Sep 2013
    Posts
    34
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    For styling, you need CSS on that. Try downloading other free themes and grab their nav menu styling. Good luck!

  6. #6
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I have managed to get it to show the styling now but am trying to get my site navigation to look like this one what i did for my test site.

    Budget Removals
    But it is showing up like this

    http://budgetremovalsuk.com/splash-page.html/qa/

    I took the navigation from the site below

    Big Menus, Small Screens: Responsive, Multi-Level Navigation | Webdesigntuts+


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
  •