Support » Plugin: Nav Menu Roles » Where to add code fix for Displaying Menu

  • Stuckindmud

    (@stuckindmud)


    There is a line of code that needs to be changed in Nav Menu Roles
    CODE
    wp_nav_menu( array( ‘theme_location’ => ‘primary-menu’, ‘fallback_cb’ => ” ) );
    /CODE
    Where is this code located so I can change it? Sorry, not up to speed with WP internals yet.
    Thanks for any help.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author HelgaTheViking

    (@helgatheviking)

    What problem are you having?

    The main wp_nav_menu() is typically in your theme’s header.php but there are an infinite number of themes so it’s impossible for me to say for sure.

    Thread Starter Stuckindmud

    (@stuckindmud)

    Using the Nav menu role plugin, all the content and menu items show up in the menu even though several are set as public and others visible only to the Subscriber role or above. There is a comment in the FAQs addressing this very issue.
    Hopefully, that helps clarify the problem.
    Thanks!

    Plugin Author HelgaTheViking

    (@helgatheviking)

    Ok, just checking. The referenced FAQ item describes what happens when none of the menu items are available…. ie, they are all hidden.

    When there are no menu items, the wp_nav_menu() function defaults to a fallback of a menu of all the pages. The FAQ is meant to address that and disable that fallback. However, I would say that if ALL the menu items are hidden then you’re probably better off using some kind of conditional display of menus and not this plugin.

    If some menu items are public and some are for logged in users, then it sounds like you have some other issue happening. If you have even 1 public menu item that is always displayed you should never need the fallback.

    Do you have caching from somewhere?

    Thread Starter Stuckindmud

    (@stuckindmud)

    Thanks for the explanation. I do have several menu items that display for Everyone so that seems to rule out the need for the code.
    I did turn off and clear one caching component but it did not affect the behavior of the plugin.
    Not sure where we go from here, your plugin does exactly what I need but it’s a bit problematic at the moment. Any other thoughts on what might be causing the issue?
    thanks for all your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Where to add code fix for Displaying Menu’ is closed to new replies.