Created
November 10, 2012 13:48
-
-
Save CodeNegar/4051123 to your computer and use it in GitHub Desktop.
PHP: Wordpress navigation menu
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 | |
// functions.php | |
add_theme_support('menus'); | |
function reg_menu() { | |
register_nav_menus( | |
array( | |
'head-menu' => __('Head Menu') | |
) | |
); | |
} | |
add_action( 'init', 'reg_menu' ); | |
?> | |
<?php | |
// inside theme | |
if (function_exists('wp_nav_menu')){ | |
wp_nav_menu(array( | |
'container_id' => 'menu_box', | |
'theme_location' => 'head-menu' | |
)); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment