Skip to content

A plugin that enables you to dynamically select a menu for a single page from within the admin interface.

Notifications You must be signed in to change notification settings

ksmandersen/Dynamic-Wordpress-Menus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

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

About

A plugin that enables you to dynamically select a menu for a single page from within the admin interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages