[theme-reviewers] wp_nav_menu walker giving error

Christine Rondeau christine at bluelimemedia.com
Sun Jul 6 15:50:16 UTC 2014


hi Prayas,

You may want to post your question on the support forums
http://wordpress.org/support

The theme reviewer listing is not intended for support questions.
Christine Rondeau
Bluelime Media
www.bluelimemedia.com
twitter: @bluelimemedia
skype: bluelimemedia









On Sun, Jul 6, 2014 at 5:40 PM, Prayas Sapkota
<prayas at phpprogrammernepal.com> wrote:
> 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
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>


More information about the theme-reviewers mailing list