In the wordpress dashboard I've created a menu under appearance -> menus and named it "my-menu".
Using example code from <a href="http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items" rel="nofollow">this page</a> I'm trying to build the menu. In my
I add the following code:
Basically on every page the
is an empty array even though I've created and saved the menu. Was hoping to create menus and having the name of it in a custom field so every page can have it's own menu (or nothing when left empty or default menu when custom field not provided).
Guess I'm not getting the way wordpress intends the user to use it, maybe it's just a checkbox somewhere. I did notice that when I check the box
under Appearance -> Menus the array returned isn't empty but
is not set.
Using wordpress 3.6.1 with a modded blankslate theme.
<strong>[UPDATE]</strong>
The functions.php is hardly changed and the register_nav_menus is set with the following parameter:
I guess that's where the
checkbox in Appearance -> Menus on the Dashboard comes from. Commenting out this line makes
disappear all together.
Using example code from <a href="http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items" rel="nofollow">this page</a> I'm trying to build the menu. In my
Code:
/wp-content/themes/blankslate/header.php
Code:
$menu_name = 'my-menu';
$locations = get_nav_menu_locations();
print_r ($locations);
Basically on every page the
Code:
$locations
Guess I'm not getting the way wordpress intends the user to use it, maybe it's just a checkbox somewhere. I did notice that when I check the box
Code:
Main Menu
Code:
$locations[ $menu_name ]
Using wordpress 3.6.1 with a modded blankslate theme.
<strong>[UPDATE]</strong>
The functions.php is hardly changed and the register_nav_menus is set with the following parameter:
Code:
array( 'main-menu' => __( 'Main Menu', 'blankslate' ) )
I guess that's where the
Code:
Main Menu
Code:
Menus