The PilotPress plugin comes with the ability to hide or reveal content using shortcodes. These nifty little show-if tags can be placed around blocks of text, forms, etc in the body of your WordPress pages to allow you to personalize the content of the page based on membership level, tags or even if the contact is currently being tracked by ONTRAPORT. The Shortcodes currently available for use in PilotPress are shown in the sections below.
Note: If you're not comfortable using shortcodes, we highly recommend simply protecting pages, posts or categories instead. See this article for detailed information.
|[show_if has_one="Many,levels"] content [/show_if]||Displays content only for members who are logged in and have ANY of the membership levels listed (separated by commas)|
|[show_if has_all="Many,levels"] content [/show_if]||Displays content only for members who are logged in and have ALL of the membership levels listed|
|[show_if not_one="Many,levels"] content [/show_if]||Displays content for members who are logged in and are missing ALL the memberships listed.|
|[show_if not_any="Many,levels"] content [/show_if]||Displays content for members who are logged in and are missing any of the memberships listed.|
Showing content to members with any of these membership levels: Gold, Silver or Bronze:
[show_if has_one="Gold,Silver,Bronze"] Content for any of these members here [/show_if]
A person with the Gold membership level will see the content, even if they do not have Silver and/or Bronze. They must have at least one of the levels, and can have all three.
Showing content only to members that have both the Gold and Silver membership levels:
[show_if has_all="Gold,Silver'] Content only for those with both Gold and Silver memberships [/show_if]
A person must have both the Gold and Silver membership levels to see the content. They can also have other membership levels, but must have all of the ones listed.
Showing content to people without a particular membership level:
[show_if not_one="Gold"] Content telling the member to upgrade to the Gold membership[/show_if]
This is often used to encourage a member to upgrade their membership to another level, without bothering those members who have already upgraded.
Show Content Based on a Single Tag
|[show_if has_tag="Tag"] content [/show_if]||Displays content only for members who are logged in and have the tag indicated by "Tag"|
You can have this shortcode reveal the content within a few seconds of adding the Tag in ONTRAPORT, even if the Member remains logged in, provided:
- You have checked the Disable API Caching check box in Settings > PilotPress > Advanced Settings
- The page must be refreshed, or the Member must navigate to the page with shortcode on it after the Tag is added to the Contact Record in ONTRAPORT.
Note that this function checks only for a single tag. You cannot use multiple tags in the shortcode.
You can use this function to reveal content without adding a membership level. A Rule on an opt in or order form could add the Tag to the Contact Record and the content would be available almost immediately. Note that some functions may take longer to update the Contact Record in ONTRAPORT; a global Rule that triggers when a Tracked Link is clicked or a URL is visited can take 7 to 10 minutes to register in the Contact Record. Rules on forms generally add a Tag within a few seconds.
For Logged in Members Only
|[show_if is_contact] content [/show_if]||Displays content if logged in member is also a Contact in ONTRAPORT.|
|[show_if not_contact] content [/show_if]||Shows content if the logged in member is NOT a Contact in ONTRAPORT.|
For Any Cookied Contact (logged in or not)
ONTRAPORT contacts are cookied if they have previously logged into your membership site or take any ONTRAPORT defined action (email click, form fill out, tracked link click, etc.)
|[show_if is_cookied_contact] content [/show_if]||Displays the content if PilotPress can read an ONTRAPORT cookie.|
|[show_if not_cookied_contact] content [/show_if]||The content is displayed if PilotPress does not find a cookie.|
We now have aliases for show-if shortcodes, Login Pages, and Merge Fields. These are used when other WordPress plugins have merge field conflicts with Pilotpress. In order to use the alias, simply add "pilotpress_" in from of the field name, but after the first bracket ( [ ).
Examples of alias format
The aliases are formatted as follows:
If you have [show_if has_tag="thistag"] use the alias [pilotpress_show_if has_tag="thistag"]
If you have [login_page] use the alias [pilotpress_login_page]
Old merge fields will continue to work, however now they will insert as: "[pilotpress_field name='First Name']""
You can nest Merge Fields inside of a Shortcode.
Example: [show_if has_tag="thistag"][pilotpress_field name='First Name'][/show_if]
Wordpress Administrators are "cookied" by WordPress. WordPress will read the Administrator's cookie even while logging in as another user. Private and incognito modes in your browser will not prevent WordPress from reading the Administrator cookie. Because of this, shortcodes and membership level protection may appear to fail. To test shortcodes and other membership functions we recommend the following process:
Create a new Contact for testing purposes. Add a Membership level to the contact. Keep ONTRAPORT open to this contact record.
In the private tab or window, clear the cookies for your Wordpress site. This step is required. To see instructions on how to clear your cookies, click HERE.
Go to the default WordPress login page by adding "/wp-login.php" to your domain: http://your-domain.com/wp-login.php
Log in as your new contact. Test the functionality of your membership levels and shortcodes.
To test a new membership level, log the contact out of Wordpress. Add the new membership level in ONTRAPORT and log the contact back into Wordpress.
- You must use a private browsing window and clear your site's cookies in order to log in with a Contact's login credentials.
- You cannot nest the show-if tags due to a limitation of WordPress.
- Other plugins may interfere with PilotPress, including (but not limited to):
Any other "membership" plugin
Any plugin that manages "redirection"
All in One SEO
- Yoast WordPress SEO
Page Expiration Robot or Scarity Samuri
User Role Editor
Login Form Editors (using redirection)
Check with Support if you believe you have a conflict with another plugin.
WordPress Integration Resources
Articles in this section
- WordPress Integration Overview
- Integrate an Existing WordPress Site
- Creating Membership Levels
- Integrate a New WordPress Site
- Protect Content on Pages, Posts and Categories in WordPress
- Add Members & Release Drip Content in WordPress
- Add Membership Login & Password Functions in WordPress
- Enable the Customer Center
- Enable the Affiliate / Partner Center
- Use Shortcodes to Show/Hide Content on a WordPress Page