We build stellar websites!

FREE 1 Hour Consultation!

WordPress Plugins » Ezy Nav Menu


EZY Nav Menu

Makes use of WP's built in 'Edit Links' to create and manage a website navigation menu that can be displayed using a custom template ta

Download

Contributors: acurran
Donate link: http://sww.co.nz/payments/
Tags: template tags, navigation, menu, nav menu, CMS, CMS enabling plugin, navigation links
Requires at least: 2.1
Tested up to: 3.0.1
Stable tag: 0.4


Description

Update 13 Sept 2010: As of WordPress 3.0 this plugin has become redundant because WordPress has built in some pretty cool menu creation features. This plugin still works and should do so in future versions of WP so you can still use it if you like this way of doing it. To learn more about the new menu features in WP, I refer you to this tutorial by Justin Tadlock

As well as being the leading blogging platform, WordPress is also one of the most flexible and easy to use general purpose content management systems for a wide variety of websites. However, one important CMS feature that is missing in the 'out of the box' installation of WordPress is a navigation menu management interface. A number of attempts have been made at plugins to address this need but most have been overly complex or cumbersome in some way so I have always coded my own navigation systems into my website templates.

After experimenting with a few different approaches for building navigation menus for a number of different websites, I discovered that WordPress actually does have an interface for managing navigation menus - well 'sorta'... I found that one good approach to creating navigation menus that could be easily managed by my clients is to use WordPress's built in links management interface. All it takes is a few lines of PHP code in the header template file to utilise the links navagation interface for the purpose of managing the website navigation menu. I have used this approach for building single level and multiple level navigation menus.

Now I have turned this approach to navigation menus into a simple plugin. This initial version adds the template tag 'show_nav()' which generates a single level navigation menu from the links contained in a 'nav' category. It is intended for use by users who create or edit their own templates. A multi-level version may follow.


Installation

  1. Upload the file ezy-nav-menu.php to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress

If updating plugin please deactivate plugin and reactivate after uploading.

Usage:

Additional Usage Options:


Frequently Asked Questions

Is this plugin for me?

If you create or modify your template (theme) files and know a little CSS - Yes. If you've never opened a template file - maybe not this version, but soon I may do a version suitable for 'non-template' editing people too.


Screenshots

  1. No new interface! Just uses WP's existing 'Edit Links' interface. Simple!

Change Log

Version 0.4 (21 Aug 2009)

Updated so that class='current' gets added to nav link when on a child page as well as when on the page itself

Version 0.3 (13 Jul 2009)

Added option for seperator

Version 0.2 (23 Apr 2009)

Added before and after HTML snippet capability and the option to display menu as unordered list

Version 0.1

Initial release - single level navigation only


26 Responses to “Ezy Nav Menu”

  1. WordPress Plugin Releases for 02/10 | MBConsulting.se Says:

    [...] Ezy Nav Menu [...]

  2. Zohar Manor-Abel Says:

    Hi, thanks for the great plugin and simple idea.

    Would be nice though to have the ability to have multiple Links categories to be used with this plugin. Like a different menu for header nav, and footer nav, especially concerning the css. Also would be nice if the output is in list items.

    Thanks again!

  3. Ray Says:

    The ability to use WordPress categories as menu items and to have multi-level support would be nice as well.

  4. WordPress Plugin Releases for 04/27 | Weblog Tools Collection Says:

    [...] Ezy Nav Menu [...]

  5. WordPress Plugin Releases for 04/27 | The Latest Headlines Says:

    [...] Ezy Nav Menu [...]

  6. riclad Says:

    I’m not following this.

    When I place show_nav() in header all I get is show_nav() in the header on the front page.

  7. riclad Says:

    What does this mean?

    Generate “the following output” where? And once it’s generated, what are you supposed to do with it?

    —————————————-
    This will generate the HTML output:

    [Link name]

    —————————————–

  8. Aidan Says:

    @riclad: have you got show_nav() inside < ?php ?> tags in your header template file? If it is there, it will either generate the output or generate an error (if the plugin is not activated).

  9. riclad Says:

    The instructions say nothing about php tags.

    I’ll try it, but shouldn’t the instructions say it, if it’s required?

  10. Aidan Says:

    @riclad: in the description of the plugin: “… displayed using a custom template tag

  11. William Howard Says:

    Style the navigation menu in any way you want in the CSS using the style hooks provided (i.e. div#nav, div#nav a, div#nav a.current, div#nav a:hover, etc.).

    Where are these style hooks provided? I have got the hooks above to work through trial and error but what are the rest? Am I just missing them somewhere or is this knowledge I should already have.

  12. Aidan Says:

    The output HTML generated by the plugin is shown above so it’s just a matter of styling it with your css.

  13. Aidan Says:

    Please note also the additional note I’ve added to the instructions regarding what is required for the plugin to add class=”current” to the link for the current page.

  14. Leander Says:

    Great plugin, it is easy and handy, but I simply can’t get the class=”current” feature working… I’ve read through all the documentation several times, but I can’t find the added note that you mention. I’d hate having to write at PHP script to compare current page with link when obviously the feature is there, only I can’t shake it out from its’ vault…

    I’m using
    <?php show_nav("nav", "nav", "”, “”, true); ?>

  15. Aidan Says:

    @Leander – The note I mention is the paragraph above “Note: for the class=”current” to get added to link for current page, you need to have permalinks set so it is not using the default query string type links and you need to enter relative paths starting with / in your links (i.e. drop the http://mysitename.com part).”

    This is the most likely reason it’s not working for you – you need to use relative URLs for it to work.

  16. Leander Says:

    Thank you for the quick reply. You were so right. It was the permalink issue. I’ve got it working now. However I’m using 0.2 of the plugin because the 0.3 renders an unexplicable “1″ between each menu item and breaks the “horisontalness” that I’ve styled for the menu. The 0.2 version works like a charm though… Thanks for a great plugin

  17. baron Says:

    Works great, thank you

  18. Stanley Says:

    nice plugin, i downloaded, will test it on my blog.
    thank you

  19. Shelley Says:

    I love this plug in. Thank you. It works beautifully!
    Any luck working out a multi-level version?

  20. Aidan Says:

    @Shelley – I have custom coded multi-level menus in the past using this technique but never got around to making it a releasable plugin. These days I tend to use wp_list_pages when I need multi-level menus.

  21. Zohar Says:

    Hey, I’m using EZY Menu on a few sites now, but I can never get the ‘current’ class to appear on child pages too.
    Is there a specific way to make this happen?

  22. Zohar Says:

    Just to add that the EZY is on the navbar (as a parent or ancestor), to the child pages on a sidebar menu, using wp_list_pages, and ignoring the main parent.

  23. Aidan Says:

    @Zohar: make sure the link url matches the slug and it is a relative url starting with /

  24. Tony Says:

    Is there a web site where I could see this plugin in action? Thanks!

  25. Aidan Says:

    @Tony: e.g. http://sawmilldirect.co.nz/, http://www.taxreturn.co.nz/

  26. Jacques Preiss Says:

    Aidan, I found your plugin yesterday and “plugged-it-in” on two blogs so far. This is truly a piece of Kiwi Ingenuity! Real No.8-wire type of stuff! Well done, I love it!

    Jacques
    Wellington

Leave a Reply