wordpress snippets last updated   : April 14, 2014
we now have 630 snippets
category wp_nav_menu

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

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

Add a custom CSS class to wp_nav_menu

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a custom class to the wp_nav_menu navigation within your wordpress theme.

read more

Add the date to a specific wp_nav_menu

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will insert the date into your wordpress wp_nav_menu(). Don’t forget to change MENU_NAME to the name of the menu you wish to add the date.

read more

Display different menus for logged-in users

wordpress snippet

Adding this snippet in the location you wish to display your navigation, would show one menu to logged-in users and another when they are not logged-in.

read more

Add a home link to wp_nav_menu

wordpress snippet

If you are using the wordpress 3+ wp_nav_menu with your theme adding this snippet to the functions.php will add a home link to your navigation with the current-page-item class.

read more
jqsnipp.com | we just launched jquery snippets website