updated   : May 15, 2012
we now have 588 snippets
category wp_nav_menu
By : , on February 24, 2012 12:30 pm

Add search form to specific wp_nav_menu

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add the search form to your wordpress wp_nav_menu. Don’t forget to update the MENU-NAME to specify the menu you wish to display within, just in case you have multiple menus.

read more
By : , on October 10, 2011 9:00 am

Display top 8 authors in wp_nav_menu using wp_list_authors

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add an authors item to your wp_nav_menu listing top eight authors by post count.

read more
By : , on October 08, 2011 9:00 am

Insert calendar into wp_nav_menu

wordpress snippet

Needed this for a recent project as a client wanted to display the wordpress calendar as a dropdown item within the menu. Add this snippet to the functions.php of your wordpress theme will add a new menu item to your wp_nav_menu that has a submenu calendar.

read more
By : , on September 21, 2011 9:00 am

Remove every class and id from the wp_nav_menu

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will remove nearly every class and id from the wp_nav_menu except for the current-menu-item class. This is a great little snippet that will make your wp_nav_menu a little cleaner enjoy.

read more
By : , on August 18, 2011 9:00 am

Update: Add bookmark links to the wp_nav_menu

wordpress snippet

This is an updated version of the previous snippet I posted on the 11th, I added support for link “target” and “link relationships (XFN)” Adding this snippet to the functions.php of your wordpress theme will add bookmarks from a specified category to the wp_nav_menu.

read more
By : , on August 11, 2011 9:00 am

Add bookmark links to the wp_nav_menu

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add bookmarks from a specified category to the wp_nav_menu. This also supports the sub-menu class so you can create pure css dropdown menus.

read more
By : , on August 05, 2011 9:00 am

Get assigned menu location with get_nav_menu_locations

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you get the name of an assigned menu based on the location name. Returns false if the defined location has no menu assigned. Useful for assigning titles to menus.

read more
By : , on July 28, 2011 9:00 am

Add a login link to the wp_nav_menu

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a login link to your wp_nav_menu or if the user is already logged in a logout link.

read more