How to enable WordPress 3 custom navigation menu feature on web2feel themes.

Introduction of custom navigation menu system is a highlight of the WordPress 3 release. This gives the theme users so much freedom to configure the navigation menu without touching a single piece of code. Now it will be possible to arrange menu items and configure the hierarchy of the menu items on a fly. Web2feel themes created prior to the WordPress 3 release will not have this feature enabled on them. So you wont be able to configure the menu items on those themes through the custom menu interface. So I decided to make a screencast explaining how one can configure the old themes to harness this new menu feature.

The screencast is of 10 mins divided into 2 parts of 5 mins each due to the time limit of the screenr.  To enable the menu feature first you need to edit the function.php file of your theme. Just open the file on any text editor and add the following code in it.

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

Now we have enabled the custom menu feature and declared a menu location called primary .Next step is to place the navigation menu code where you want the menu to appear. In most cases it is on the header.php file.  So look for the existing  page menu or category menu encased in the ul tags.

<ul>
 
	<li class="page_item &lt;?php if ( is_home() ) { ?&gt;current_page_item&lt;?php } ?&gt;"><a title="Home" href="&lt;?php echo get_settings('home'); ?&gt;/">Home</a></li>
 
</ul>

delete it and paste the following code in its place.

 'primary','fallback_cb'=&gt; '' ) ); ?&gt;

Now you have enabled the menu feature and you will be able to configure the menu items from the menu admin panel.

Watch the screencasts

Part -1

Part-2

I hope it was useful to you all.. Thank you

Reference:

WordPress Codex

Justin Tadlock ( Detailed explanation of the feature, developers are suggested to read this )



  • Thanks for the post, I like to find inspiring ideas and practical knowledge to help bolster my own awareness for web design and development in general. Blogs like yours are a great source of inspiration for me and I will keep an eye open (on your rss feed) for more of your brilliant posts. Cheers!

  • Ellie

    The video was excellent. You rock!
    Ellie

  • Straightforward tutorial. Thank you for sharing. I will benefit this in time.

  • thanks for the sharing.. it help me a lot

  • “Here elaborates the matter new balance shoes not only extensively but also detailly .I support the
    write’s unique point.It is useful and benefit to your daily life.You can go those
    sits to know more relate things.They are strongly recommended by friends.Personally

  • nice video.. thanks

  • Louis vuitton
  • yeps, nice video dude..
    you explain it clearly..

  • thanks for the tips 🙂

  • Is it me or do the thumb nails not work in wordpress 3.0?

  • Leaf

    This summer you can choose Christian louboutin wedges. A pair of beautiful cheap Christian Louboutin wedges can keep you feeling effortlessly fabulous every day this summer. These can be matched with casual jeans, but these can also be dressed up with a great yellow dress.

  • Hmm really excellent video.thanks a lot for sharing..

  • That is great job! Appreciate this very much especially for someone like me who is not very technical well-versed. Thank you.

  • Fantastic tutorial. Thanks

  • This is just awesome, I really like your theme mate!

  • Submit

    Dude, I spent a couple of hours working on this. After watching your video I fixed it in a couple of minutes. Thanks!

  • Really excellent video.thanks a lot for sharing..

  • Russ

    OK I finally worked out that you MUST create menus to get the navigation to appear, but how to get the sub-menus working for categories with children. There is no option for this in wordpress to create sub-menus, and it doesn’t happen automatically, yet it is working on your demos.

    • Kim

      Russ, did you get an answer to this. As I’m stumped too. I’ve researched it extensively. There is no read file included in the Evander theme; nor any reference to use of additional plug-ins to accomplish. Non of the forums or discussion boards referencing this same problem seem to have an answer. Let me know what you find.-Kim http://estradaenterprises.com

      • Kim

        Getting the drop down menus to work are so simply you will laugh. Basically all works as the screenplay shows. However when building the custom menu; drag the ‘child’ pages or post to the right slightly to activate drop down levels. Great tutorial; can’t believe it was this simple.

  • Thanks for the post.The video was excellent.Straight forward tutorial.

  • these videos are very very good
    thanx for that

  • I like to find inspiring ideas and practical knowledge.You rock!Thank you for sharing.

  • Really excellent video.thanks a lot for sharing..

  • Really excellent video.thanks a lot for sharing..

  • radiant_luv

    Where (file) is Ul LI mentioned for the Menu items? Can’t find from below however when i see generated source i see items in li. I need to construct multicolumn subnav (when mouse over on secondary nav). Please help . thanks

    ‘menu’, ‘fallback_cb’=> ”,’theme_location’ => ‘secondary’ ) ); ?>

    • Anonymous

      The tags are auto generated by the wordpress based on the settings you make in the menu admin panel. Thats the beauty of this new feature.

  • these videos are very very good .

  • nice video..

  • It won’t works for “Pristillo” theme……………

  • Great codes thanks for sharing.

  • lorraine

    That’s amazing. Your post give me great impression. To be frank, I love this author very much. Not only your post,but also your writing style. That’s so great! Come on! No doubt that someone in the facebook always mention you.
    TOYOTA Navigation DVD http://www.topons.com/toyota-navigation-c635.html

  • John

    I need some help.
    The question about having a second navigation menu hasn’t been answered yet? Hopefully, the answer wasn’t it being incomplete. I hope someone can shed some light as to how to create more than one menu.

    ps. I have tried all the examples and still no luck. the theme location stuff isn’t working. this is what I have in my functions,

    add_action( ‘init’, ‘register_my_menus’ );
    function register_my_menus() {
    register_nav_menus( array(
    ‘header-menu’ => __( ‘Header Menu’ ),
    ‘content-menu’ => __( ‘Content Menu’ ),
    ‘footer-menu’ => __( ‘Footer Menu’ )
    ));
    }

    and within the theme at different locations I would add,
    ‘header-menu’, ‘fallback_cb’ => ” ) ); ?> or ‘content-menu’, ‘fallback_cb’ => ” ) ); ?> or ‘footer-menu’, ‘fallback_cb’ => ” ) ); ?>. I am still not getting the menus I created in the backend to show up accordingly.

    Thanks.

  • That’s amazing. Your post give me great impression. To be frank, I love this author very much. Not only your post,but also your writing style. That’s so great Come on No doubt that someone in the facebook always mention you. In the same way you can create more menus. Instead of ‘primary’ you can use ‘secondary’ etc.

  • Thanks a lot!

  • thank you very much