Some parts of your articles may include information you would like to show only to members with special privileges.
For example, in our hypothetical membership site, we want to provide expert advice to Premium and VIP members only, which may encourage other visitors to purchase the subscription.
Compare the following images.
To restrict access to certain parts of your post to users only with specific roles, use the Toolset Access plugin and its conditionally displayed text feature.
- Open your post for editing.
- Click the “Access” button to insert conditionally -displayed text.
- In the dialog that opens, select roles for those whom you wish not to view your text. In our example, we want to hide expert advice from Subscribers and Guests.
- Enter the text you want to hide from these users.
- In the section entitled “Will these roles see the text?” choose “Everyone except these roles will see the text.”
That part of your article can then be accessed by those with the remaining roles.
Your post will look like this:
Notice that the text is wrapped with [toolset_access] shortcode using the “deny” operator. You can use the same shortcode with the “allow” operator to specify what these users will see instead.
For example, it can be a message followed by a link to the Buy page.
[toolset_access role="Subscriber,Guest" operator="allow"] <strong>Premium</strong> or <strong>VIP </strong>membership required to see Expert advice. <a href="#">Choose your plan.</a> [/toolset_access]
Check our documentation for more details.