Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi Don,

    There’s no official support (yet), but you can try adding this to your themes functions.php rather than modifying the walker.

    function megamenu_item_description( $item_output, $item, $depth, $args ) {
        if ( property_exists($item, 'description') && strlen($item->description) ) {
            $item_output = str_replace( $args->link_after . '</a>', '<div class="menu-item-description">' . $item->description . '</div>' . $args->link_after . '</a>', $item_output );
        }
        return $item_output;
    }
    
    add_filter( 'megamenu_walker_nav_menu_start_el', 'megamenu_item_description', 10, 4 );

    Regards,
    Tom

    Thread Starter Don Betts

    (@dbetts)

    Thanks, Tom. Worked like a charm.

    Any plans to roll description support into the plugin in the future?

    Plugin Author megamenu

    (@megamenu)

    Hi Don,

    Yep, it’s on my todo list.

    Regards,
    Tom

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Menu Descriptions’ is closed to new replies.