A plugin that enables you to dynamically select a menu for a single page from within the admin interface.
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
screenshots
DynamicMenus.php
Readme.markdown

Readme.markdown

Dynamic Wordpress Menus

This simple plugin for Wordpress enables you to select a menu for a single page from within the admin interface in Wordpress. It is also possible to get the parent menus in nested page structures.

Notice: This plugin relies on the Meta Box Script for Wordpress by RILWIS which you can download for free here.

Usage

When activating the plugin a meta box will appear whenever editing a page like so:

metabox

You can then access the set menu in your theme like so:

// Get the ID of the set menu
$menu_id = get_menu_for_page($post->ID);

// print the menu if set
if($menu_id > 0)
    wp_nav_menu(array('menu' => $menu_id));

The plugin searches parent pages for set menus if no menu is set by default. This can be disabled by calling the the function like so:

$menu_id = get_menu_for_page($post->ID, false);

Licensing

This plugin is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

CC