Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have been assigned with the task to create a menu that can be added or removed from wordpress admin. Right now the menu is hard coded into the templates. But I want to use default menu function wp_nav_menu and the menu should look exactly like before.

But trying for the whole day i cannot figure how to make the menu using wp_nav_menu and look exactly like the menu item currently having in this site. I can make the menu using wp_nav_menu but the menu is looking like a mess and not like this.

share|improve this question
4  
wp_nav_menu will will create HTML. You need to format it with CSS. Without seeing the broken menu if possible and the code it is hard to say much else. –  s_ha_dum Nov 6 '12 at 16:02
add comment

1 Answer

In your theme's functions.php, write the following code:

<?php
/* ENABLING CUSTOM MENUS
-------------------------------------------------- */
//add_theme_support( 'menus' );

    register_nav_menus(
        array(
        'primary'=>__('Primary Menu'),
        'secondary'=>__('Secondary Menu'),
        )
    );
?>

It'll register two custom menu area for your theme.
Then you need to achieve it with in header.php:

<?php wp_nav_menu ( array ( 'theme_location'=>'primary', 'fallback_cb'=>'') ); ?>

This code will place only the Primary Menu area in your theme.
Now you need to code the CSS, and These whole bunch of code is really amazing! I found it from a tutorial site.
Try it and then modify it as per your need, and then find the author of the code (not me) and thanks him. :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.