Make Sure You’re Updated
The feature described below only works if you’re running Memberium 1.151 or greater. You’ll also need to be on WordPress 5.4.1 or greater. Contact support with any questions.
In this post, we’ll show you how to display or hide menu items in WordPress conditionally based on a member’s existing ActiveCampaign tags, membership levels, or logged-in status.
If a certain page or post is protected by a membership level, and the prohibited action is set to hide or redirect, Memberium will automatically hide that menu item from a member that doesn’t have that ActiveCampaign tag to access that membership level.
With Memberium’s most recent updates, controlling who can see certain menu items has never been easier. You don’t need to know PHP or be a computer expert in order to follow this guide and implement this on your site.
How can I use this on my membership site?
Controlling menu items conditionally can be used a lot of different ways to make your Membership site more dynamic for your members based on their past interactions and current membership level. Here are a few examples of how you could use conditional menus with your WordPress site:
- Showing sales page links to visitors who haven’t bought a certain course or product yet.
- Hiding sales page links/offers from customers who have purchased them already.
- Dripping content through your main navigation menu.
- Unlocking new content sequentially upon completion with LearnDash.
- Showing or hiding certain links, opt in’s or targeted offers based on a user’s existing ActiveCampaign tags.
- Displaying a log out / log in link if a user is logged in or not.
In the past, we recommended you install a third-party plugin to accomplish this, but in an effort to make things easier for our customers, we’ve now included this functionality right into Memberium.
First, just make sure your Memberium plugin is updated to our latest version. This ensures you have this feature and our latest additions/improvements.
Next, you’ll navigate to Appearance > Menus and click on the menu item you’re wanting to set conditions for.
Here’s an overview of all the conditions you can use to control the visibility of menu items on your site.
How to display a menu item to members who have any of the following ActiveCampaign tags:
To display a menu item to a member who has a specific ActiveCampaign tag, first set the User Status to Logged In Users Only. This will open up more options including the Require Tag ID(s) box. From there, simply type in the name or ID of the tag you want to require members have.
If you select multiple tags, the member will only be required to have one in order to see the menu item.
You can also require that a member NOT have a certain tag. Each tag will have a “Does Not Have” version beneath it. Select that and anyone who has the tag in question won’t be able to see the menu item.
How to display a menu item to members who have two ActiveCampaign tags:
In certain situations, you’ll want to display a menu item to members who have two tags in ActiveCampaign – requiring they have both in order to see the menu item.
First set the User Status to Logged In Users Only. This will open up more options including the Require Tag ID(s) box and the AND Require Tag ID(s) box. In the first box, type in the first tag you want to require. In the second box, type in the second tag. With one tag in each box, the member will need to have BOTH tags in order to see the menu item.
If you were to put multiple tags in each box, the member would only need one tag from each box in order to see the menu item.
How to display a menu item to members with a specific membership level:
You can show menu items only to members with specific membership levels by clicking in the membership dropdown and selecting the levels you want to see the menu item.
An example of how you could use this type of logic could be used to display a sales page link to members who are enrolled in our “Free Course”.
Keep in mind – if a certain page or post is protected by a membership level, and the prohibited action is set to hide or redirect, Memberium will automatically hide a menu item from a member who doesn’t have the ActiveCampaign tag to access that membership level. The menu item will also be hidden from logged out visitors.
Display a menu item only to logged-in users:
To only display a menu item to members who are logged in, you’d set the User Status to “Logged In Users Only” and you’d leave all the settings blank.
This menu item will be hidden completely from any logged out user and will only display to visitors who are logged in.
As an example, you could use this to show a logout link only to members who are logged into the site.
Another use case could be to hide My Account pages from members who are logged out. This will keep your menu clean for people who aren’t logged in.
Display a menu item only to logged out users:
To only display a menu item to members who are logged out, you’d set the User Status to “Logged Out Users Only”.
Only users who are logged out would be able to see this menu item.
A real-world example could be a link to your login page or a link to a sales page.
Combining Multiple Functions to Create Advanced Conditions
You can combine multiple functions above to create advanced conditions. You can also use the PHP Boolean Expression box at the bottom to define custom yes/no output expressions that will determine the visibility.
As an example let’s say we want to display a menu item only for “Gold” Members who also have the ActiveCampaign tag id of “130”:
memb_has_Membership( "Gold" ) && memb_hasAnyTags( "130" )
If we wanted to reverse the logic of the previous example, you’d just prefix each boolean with an exclamation mark “!” like so:
!memb_has_Membership( "Gold" ) && !memb_hasAnyTags( "130" )
As you can see, PHP Boolean expressions can be combined by adding two ampersands && in between them.
You can find all the conditional expressions on this page under the “Conditional Functions” heading.
There are tons of other possibilities of how you could use this feature to create a more personal and unique experience for your members. If you have any questions about how to use conditional statements with Memberium don’t hesitate to contact support if you need any help.