[theme-reviewers] wp_nav_menu walker giving error

Prayas Sapkota prayas at phpprogrammernepal.com
Mon Jul 7 00:40:00 UTC 2014


Hello Guys,

I am having trouble with wp_nav_menu walker function.

It is giving me error: *Notice*: Trying to get property of non-object in 
*D:\xampp\htdocs\...\wp-includes\nav-menu-template.php* on line *153 & 156.

*My code is below:
-----------------------------------
wp_nav_menu(
     array(
         'theme_location' => 'primary',
         'menu_class' => 'navbar-collapse collapse',
         'walker' => new Primary_Walker_Nav_Menu()
     )
);

class Primary_Walker_Nav_Menu extends Walker_Nav_Menu {
     function start_lvl( &$output, $depth = 0, $args = array() ) {
         $indent = str_repeat("\t", $depth);
         $output .= "\n" . $indent . "<ul class=\"dropdown-menu\">" . "\n";
     }
}

Can you guys please help me on this?

Thanks,
Prayas Sapkota
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20140706/8533b0c1/attachment-0001.html>


More information about the theme-reviewers mailing list