WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Big Voodoo Mega Menu & Related Links Menu

Enhancements to the wp-admin Menu interface that allow for faster, more robust, and easier to edit menus. Also includes a Related Links Menu.

  1. Install the plugin in WordPress & activate it.
  2. register a menu location in your theme.
  3. Setup the menu hierarchy under Appearance -> Menu.
  4. Assign the menu from step 3 to the menu location in step 2.
  5. Use one of the shortcodes to display a menu.

Shortcodes

[mega_menu]

Given a theme_location attribute, this shortcode displays a ul-style Mega Menu for the menu assigned to that location, which can be easily styled with CSS in your theme. Options:

  • theme_location: The location in the theme to be used - must be registered with register_nav_menu() in order to be selectable by the user. required
  • before: Output text before the <a> of the link
  • after: Output text after the </a> of the link
  • link_before: Output text before the link text
  • link_after: Output text after the link text
  • ajax: if "true", loads the Mega part of the menu via AJAX.

Example: [mega_menu theme_location="mega" before="<div class='surround'>" after="</div>" link_before="<span>" link_after="</span>"]

[related_links]

Given a theme_location attribute, the shortcode displays a Related Links Menu for the menu assigned to that location, which shows either children, siblings, or top-level pages (chosen in that order). Options:

  • theme_location: The location in the theme to be used - must be registered with register_nav_menu() in order to be selectable by the user. required
  • before: Output text before the <a> of the link
  • after: Output text after the </a> of the link
  • link_before: Output text before the link text
  • link_after: Output text after the link text

Example: [related_links theme_location="mega"]

Filters

walker_nav_menu_start_el

Allows modification of the $output, called when the Walker has created an <li> and started populating it.

Arguments:

  • $output: the output for the menu so far.
  • $item: the current menu item.
  • $depth: the current depth.
  • $args: the arguments passed to Walker_Nav_Mega_Menu.

Example:

function override_nav_menu_start_el( $output, $item, $depth, $args ) {
    if( $args->menu_type == 'mega' && $depth == 0 && $args->ajax !== "true" ) {
        // add header
        $output .= '<h2>' . get_the_title( $item->post_id ) . '</h2>';
    }
    return $output;
}
add_filter( 'walker_nav_menu_start_el', 'override_nav_menu_start_el', 99, 4 );

walker_nav_menu_end_el

Allows modification of the $output, called before the Walker adds </li> and after any children are added to the $output.

Arguments:

  • $output: the output for the menu so far.
  • $item: the current menu item.
  • $depth: the current depth.
  • $args: the arguments passed to Walker_Nav_Mega_Menu.

Example:

function override_nav_menu_end_el( $output, $item, $depth, $args ) {
    if( $args->menu_type == 'mega' && $depth == 0 && $args->ajax !== "true" ) {
        // add footer
        $output .= '<div class="menu_footer">footer for ' . get_the_title( $item->post_id ) . '</div>';
    }
    return $output;
}
add_filter( 'walker_nav_menu_end_el', 'override_nav_menu_end_el', 99, 4 );

Requires: 3.5 or higher
Compatible up to: 3.6.1
Last Updated: 2014-5-7
Downloads: 1,371

Ratings

0 stars
0 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,3,3
100,1,1
0,1,0