1

i have created Multisite. i have assigned menu for the first sub domain while for the second sub domain i have not assigned Menu.

i just enabled the Debug mode and got Following error:

Notice: Trying to get property of non-object in /home3/public_html/project/myproject/wp-includes/nav-menu-template.php on line 154

i gone through couple of article and they suggested solution to use Fallback 'fallback_cb' => 'wp_page_menu', . i did try it but still shows Errors.

  $defaults = array(
      'theme_location' => 'primary',
       fallback_cb' => 'wp_page_menu',
       'menu_class'=> 'nav navbar-nav',
       'walker' => new My_Walker_Nav_Menu()
                   );

      wp_nav_menu( $defaults ); 

is there any solution for it? how to fix it?

1

try and add your location as a parameter.

 <?php
if ( has_nav_menu( $location ) ) {
     //Do something
} ?>  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.