How to Show or Hide Divi Builder elements using Infusionsoft Tags

Memberium Admin — 

In this post, we’ll show you how to display or hide Divi Builder conditionally based on a member’s existing Infusionsoft tags, current membership level or based on the user’s current login status (logged in or logged out).

To do this, the first step is to install and activate a free WordPress plugin called “Content Visibility for Divi Builder” to your site.

Once Content Visibility for Divi Builder is installed here’s an overview of how to display Divi Builder elements conditionally based on a members Infusionsoft tags, existing membership levels, or based on being logged in or not.

How to display an element to members with a specific membership level: memb_hasMembership

memb_hasMembership() allows you to show or hide an element by membership level.

To use this, we’ll need to find the exact name of the membership level that you want to display the widget for.

In the admin area of your WordPress site, navigate to ‘Memberium > Memberships’ and find the name of the membership level you’re looking for and copy it.

Let’s say we want to display an element only to members with the ‘Free Membership’ membership level.

You’d use the following example function in the “Content Visibility:” field (be sure to exactly match the name of your membership level, names are not case sensitive):

memb_hasMembership("Free Membership")

To display a Widget to members who are not ‘Free Membership’ members, you’d use the following function in the “Content Visibility” field with an exclamation point(!) in front of the function to reverse the visibility logic:

!memb_hasMembership("Free Membership")

How to display an element to members who have ANY of the following Infusionsoft tags: memb_hasAnyTags

The function memb_hasAnyTags allows you to display an element by Infusionsoft tag.

To find the ID for a tag that’s not a membership level (to display an element based on membership level, you should only use memb_hasMembership and not memb_hasAnyTags), you can find the tag id in Infusionsoft by navigating to CRM > Settings > Tags and the Tag ID’s are listed in the ID column as pictured below.

membhasanytags-infusionsoft-tagid

To display an element to a member who has a specific Infusionsoft tag, for example, let’s say the tag id of ‘130’, all you need to do is paste the following into the “Content Visibility” field (be sure to include your own tag ID in place of ‘130’):

memb_hasAnyTags("130")

To hide the element from anyone who has this tag, and display it to anyone without it, you just need to add an exclamation mark in front of the function:

!memb_hasAnyTags("130")

If you want to hide or show an element from anyone who has ANY of the following Infusionsoft tags you just add a comma between the tag id’s.

This will display an element to members with any of the following Infusionsoft tags:

memb_hasAnyTags("130,128")

This will hide an element from any member with any of the following Infusionsoft tags:

!memb_hasAnyTags("130,128")

How to display an element to members who have ALL of the following Infusionsoft tags: memb_hasAllTags

In certain situations, you’ll want to display or hide an element from members who have multiple Infusionsoft tags.

To display an element for a member who has ALL of the Infusionsoft tags specified you would use the following function in the “Content Visibility” field (be sure to add your own tag id’s in place of the example):

memb_hasAllTags("130,128")

To hide a Widget from a member who has ALL of the following Infusionsoft tags you would use the following in the “Widget Logic” box:

!memb_hasAllTags("130,128")

How to display an element based on a user being logged in or out: is_user_logged_in

To display an element only to members who are logged in, you’d use the following example in the “Content Visibility” field:

is_user_logged_in()

This element will be hidden completely from any logged in user and will only display to visitors who are logged out:

!is_user_logged_in()