Walker_Nav_menu access parent menu name

I extended Walker_Nav_Menu with the code below and I would like to replace [TITLE HERE] with the name of the parent menu…

In my menu I only display one depth of the navigation at a time. So I would like to display the name of the submenu’s parent. How could I achieve that ?

Read More
 function start_lvl( &$output, $depth = 0, $args = array() ) {
    $indent = str_repeat("t", $depth);
        $output .= "<div data-level='$depth'>";
        $output .= "<h2>**[TITLE HERE]**</h2>";
        $output .= "<a class='close' href='#'>Close</a>";
        $output .= "n$indent<ul class="sub-menu">n";
    }

Thanks in advance.

J.

Related posts

Leave a Reply