Created
September 24, 2013 21:48
-
-
Save barbwiredmedia/6691774 to your computer and use it in GitHub Desktop.
Wordpress - Templates: wp_get_nav_menu_object , wp_nav_menu To create a navigation menu with a header right above it. Calls the menu from WP and uses the title founded under Appearance > Menus and puts it in a header tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$menu_location = 'Footer-Nav-Column-1'; | |
$menu_locations = get_nav_menu_locations(); | |
$menu_object = (isset($menu_locations[$menu_location]) ? wp_get_nav_menu_object($menu_locations[$menu_location]) : null); | |
$menu_name = (isset($menu_object->name) ? $menu_object->name : ''); | |
echo ('<h4>'); | |
echo esc_html($menu_name); | |
echo ('</h4>'); | |
wp_nav_menu(array('theme_location' => $menu_location, 'menu_class' => 'nav')); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment