We’ve blogged previously about using the Nav Menu Roles plugin along with the PMPro Roles add on to create conditional menu items. Here’s another tutorial that demonstrates two options for conditional navigations menus: editing your theme or our super cool new Nav Menus Add On.

Option 1: Edit Your Theme

This demo is particularly useful if you’re a theme author looking to build member menus directly into your theme.

Step 1: Register the Members Navigation Menu

In your theme’s functions.php file, add the following code:

function mytheme_register_my_members_menu() {
	register_nav_menu( 'primary-members', __( 'Primary Menu - Members', 'theme-slug' ) );
	register_nav_menu( 'primary-nonmembers', __( 'Primary Menu - Non-Members', 'theme-slug' ) );
add_action( 'after_setup_theme', 'mytheme_register_my_members_menu' );

Duplicate the ‘register_nav_menu’ line for every new menu needed, such as a conditional footer menu, or for each membership level on your site to create a unique menu by level ID.

Step 2: Edit Your Theme’s header.php File

The code below should replace your theme’s ‘wp_nav_menu’ code. If there are special attributes declared in your theme’s existing ‘wp_nav_menu’ code, you should mirror those for the new member/non-member menus. See this guide from the WordPress Codex for help.

//is there a user to check?
if ( is_user_logged_in() && function_exists('pmpro_hasMembershipLevel'))
	//check level
		wp_nav_menu( array( 'theme_location' => 'primary-members' ) );
		wp_nav_menu( array( 'theme_location' => 'primary-nonmembers' ) );
	wp_nav_menu( array( 'theme_location' => 'primary-nonmembers' ) );

Step 3: Create the Members and Non-Members Custom Menus


  1. In the WordPress admin go to Appearance > Menus.
  2. Click the “create a new menu” link to add a new “Members” menu.
  3. Add menu items to this menu, check the “Primary Menu – Members” Theme Location under “Menu Settings”, and save the menu.
  4. Click the “create a new menu” link to add a new “Non Members” menu.
  5. Add menu items to this menu, check the “Primary Menu – Non-Members” Theme Location under “Menu Settings”, and save the menu.

You’re Done!

From here you should navigate to your site both as a member and a non-member to verify that everything is working as intended.

Option 2: Use the Nav Menus Add On

We just released a new add on that does all of this for you. The Nav Menus Add On creates member navigation menus and swaps your theme’s navigation based on a user’s Membership Level.

This plugin duplicates all wp_nav_menus defined by your theme and creates a members version. Customize menus even further by optionally creating a level-specific navigation menu. This can be set on the Edit Membership Level screen under the “Navigation Menu” section.

View and Download the Add On

Comments (18)

Is there a way to set the menu for member level? Meaning one menu for level 1, level 2, level 3? I have customer portals based on levels and only want the right portal to appear for the right membership level.

Thanks as always for your work. You make our organization possible!

I just like the helpful info you provide to your articles.
I’ll bookmark your blog and test again here frequently.

I am slightly certain I will be informed many new stuff proper right here!
Best of luck for the following!


Is there a way to prevent the menu from caching? It’s not always showing up for my members due to my site cache.

Sorry, this question should actually be, how do we set it up so only the eyebrow menu changes? When I try to change my menu it changes my main menu not my secondary menu

Thanks for clearing that up for me. Would you mind getting in touch with our support team over on our members support forums, so that we can take a closer look at this for you and help advise how you can set this up.

Hi there, you might want to try using our nav menu add on. Especially since you mention that you do not have a widget area in your header. Have you tried that already?

If you need some for the help with this, try reaching out to our support team on our member support forums. Hope this helps!

is it correct that I can only create a non-member menu with the first option, not with the Nav Menus Add On? Or can I also modify the Nav Menus Add On files in order to achieve this?
I have a public menu (working fine) a members menu (working fine) a member level menu for only one kind of membership (working fine) now I would like to create a non-members menu for logged in people who don’t have a membership, and can’t find an option for this.


This add on does not have a feature like this at this time. The non-member (logged in) would see the same menu as the logged out “visitor”. I’ll put a feature request in for this add on but can’t promise a turnaround. If you are a support member and post a topic on the members forum we would be able to get you the needed update for your project.

Hi Kim,

I am a bit confused by this. I like the idea of setting up two menus for members and non-members (actually the first site that I’m doing with PM Pro needs 3 menus for 3 different levels), but my theme, Headway, only allows 1 navigation menu per page, so the pages that both members and non-members can access are beyond my logic. The answer is likely very simple and I just can’t see it right now; please advise.



Hi, Mike. I think if you use the PMPro Nav Menus add on, you’ll be able to set which menu is used for which level and to your theme it will look like one menu basically. Open a thread on our member forums with as much info as possible about your menus and what you need, and I’ll try to whip up instructions specifically to work with Headway.

Hi Jason. I had a parallel ticket out to Headway, and they pointed out that after menu creation, the switch between menus based on user level may be accomplished via CSS. Unfortunately, PMPro Nav Menus conflicted with my first effort at augmented menus: Nav Menu Roles, even after I changed the PMPro levels to roles using PMPro Roles plugin. But Jamie is working through the CSS setup on my website’s backend; and if it works, I could share the solution with you. I would rather not share the details of my menus in a public forum. I do not mind making you admin on the site, however, if you would like to observe the solution directly when it’s done, or solve it directly if not; and then share it with the public after.

Aaah no need to hold back a solution from everyone else; others will be able to receive help from this if I share publicly most likely. Public ask coming forthwith.

Leave a Reply

For faster support related to issues on your specific site please open a ticket in our members support area.

Your email address will not be published. Required fields are marked *