Support » Themes and Templates » start_lvl ignored in custom walker_nav_menu

start_lvl ignored in custom walker_nav_menu

  • Hi

    This is my first project involving wordpress and i’ve got stuck trying to create a custom walker for a footer menu.

    I basically want to change the menu from the <ul> <li></li> </ul> structure to a <p> <span></span> </p> structure.

    The menu and stuff is displaying file and I have been able to adjust the start_el and end_el functions without issue so I now get this:

    <ul> <span>*link*</span> <span>*link*</span> </ul>

    Which is obviously half way there, I have written the start_lvl() and end_lvl() tags as shown below but they are ignored by wordpress – nothing I put in them (even die()) is executed (which is a bit suspicious) but I know the class is being called because of the start_el() function.

    function start_lvl(&$output, $depth = 0, $args = array()) {
    $output = “\n<p class=\”sub-menu\”>\n”;

    function end_lvl(&$output, $depth = 0, $args = array()) {
    $output .= “\n</p>\n”;
    Does anyone know why this is happening – have I missed something really obvious!?

    I am running the latest version of wordpress on apache with php 5.3.6 if it helps.

    Thanks in advance,

    Felix 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘start_lvl ignored in custom walker_nav_menu’ is closed to new replies.