Add the Member’s level ID to the body class for level-specific CSS styles.

The code example below will allow you to add the logged-in member’s level ID (if available) to your site’s body class. This can prove useful if you want to change the style of or even hide elements based on level.


Default Body and Post Classes

WordPress offers several functions that can filtered by plugins to add classes to your site’s body element and posts elements. Below are the default filters Paid Memberships Pro adds to these elements:

Classes already added using the body_class Function

Membership Requirement-related
  • pmpro-body-level-required
    Added if the post requires membership.
  • pmpro-body-has-access
    Added if the logged in user has access to the members-only content.
  • pmpro-body-level-$levelID
    Added for each membership level the post requires.

Plugin Page-related
These classes will be added based on the plugin page settings.
  • pmpro-account
  • pmpro-billing
  • pmpro-cancel
  • pmpro-checkout
  • pmpro-invoice
  • pmpro-levels


The Code Recipe

This code recipe requires a Plus Account or higher.

View Membership Options

Let members access your original homepage when using the Member Homepages Add On.

The code example below will allow logged in Members the ability to access your original homepage when using our Member Homepages Add On.

This page requires a PMPro Core Account or higher.

Already have an account? Login Now »

New to this site? Register Now »

Prevent users from using an email address as their username.

The code example below will prevent users from setting their username to an email address. This is useful if you want users to use an actual username instead of using their email address in both username and email fields.

This page requires a PMPro Core Account or higher.

Already have an account? Login Now »

New to this site? Register Now »

Change “Pay by Check” wording to open up more payment options for members.

Our Pay by Check Add On adds a second payment option for members to make purchase by “Check”. With a little help from WordPress’ gettext filter, you can open up more payment options for your members. What types of changes can you make? In some parts of the world, “Check” is spelled “Cheque”. Alternately, you could use the Pay by Check Add On as a workaround to offer members the option to pay by bank transfer. This code recipe will help you rename “Check” to “Cheque,” “Pay by Bank Transfer,” “Send an Invoice” or any other messaging you desire. Our recipe below changes the words “Pay by Check” to “Pay by Cheque or Bank Transfer” on the Membership Checkout page. If you need this to say something else, edit the $translated_text variable on line 11. The Code Recipe https://gist.github.com/travislima/012893d789e57b5055bbc1570753ebf6 Customize and add this code to a helper PMPro Customizations plugin (our recommended method)….

This page requires a PMPro Core Account or higher.

Already have an account? Login Now »

New to this site? Register Now »

Styling the Checkout Page: Inline Labels and Inputs

v1.9.4 of Paid Memberships Pro introduced a table-free checkout page, improving the usability and display across device types and themes. This new layout placed the form’s input labels on their own line, above the input field.

The recipe below includes the necessary CSS to display these labels inline with the form inputs for large displays only.

Comparing the checkout page with and without the custom CSS for inline labels


The Code Recipe

You can also add this CSS directly into the ‘Additional CSS’ area of your WordPress Customizer. This is accessed via Appearance > Edit CSS in the WordPress Dashboard.

Note: Be sure to remove the <style> </style> tag when pasting this CSS into the “Additional CSS” block.

 

Allow Members to select Country and State via dropdown at Membership Checkout [New Plus Add on]

Simplify sign up and improve data quality by adding a Country and State dropdown selection field to your Checkout Page with the State Dropdown Add on.

View the State Dropdown Add On


How it Works

When the plugin is activated, two dropdown selection fields “Country” and “State” will be automatically added to your checkout form in the Billing Address section. When a user selects a Country, they will then be able to select the appropriate State of the Country that was selected.


Screenshots

When a member selects the Country of their choice, they will be able to select the appropriate States that is relevant to the chosen Country.

United States dropdown selection
United Kingdom dropdown selection

PMPro Plus members can install the add on from the Memberships > Add Ons admin page or download the plugin and manually upload to your WordPress site.

View the State Dropdown Add On

 

Allow Members to Select Auto-Renewal via Checkbox on Membership Checkout [New PMPro Plus Add On]

Offer flexible membership options without having to create duplicate levels or use custom code. Our new Auto-Renewal Checkbox add on allows members to select whether they would like a fixed term or recurring subscription membership.

View the Add On


How it Works

The add on adds a new setting on the Membership Levels > Edit page allowing the admin to turn on or off the “auto-renewal” setting. The admin can define whether the level offers an auto-renewal option, and can specify if the default behavior is automatic renewal or fixed term.

For example, if your level has an initial payment of $10 and a recurring subscription of $10 per month, the member can select to simply purchase the level for $10 for a single month or to purchase the monthly subscription.


Screenshots

Member can optionally select auto-renewal at checkout.
Member can optionally select auto-renewal at checkout.


Set the option on the level under Memberships > Membership Levels > Edit
Set the option on the level under Memberships > Membership Levels > Edit


PMPro Plus members can install the add on from the Memberships > Add Ons admin page or download the plugin and manually upload to your WordPress site.

View the Add On

Show a Different “Terms of Service” at Checkout Based on Membership Level

This simple code gist allows to you swap the “Terms of Service” message based on the membership level selected at checkout. Just create a unique page for each level’s TOS content, then update the recipe based on your Level ID -> Page ID relationships.

This page requires a PMPro Core Account or higher.

Already have an account? Login Now »

New to this site? Register Now »

Restrict Membership Signup by Email Domain (Useful for Education, Corporate, or Association Memberships)

The code recipe below allows you to limit membership signup by email address domain(s). Thanks, Harsha for this code!

This page requires a PMPro Core Account or higher.

Already have an account? Login Now »

New to this site? Register Now »

Membership Signup Popover Using OptinMonster with Exit Intent

We’re conducting a month-long experiment using OptinMonster and will soon be posting the real stats. Here’s how to implement your own Optin with Exit Intent linking to a membership checkout (including “PMPro Affiliate” tracking, too).

This tutorial uses the OptinMonster WordPress Plugin. OptinMonster is now a hosted platform – so I’ll post a new tutorial on using the hosted method after our experiment ends.

But first… a screenshot of my popover:

pmpro-free-optinmonster



1. Install and Activate OptinMonster WordPress Plugin

You can install the plugin directly in your WordPress Admin under Plugins > Add New > OptinMonster or download the plugin here: OptinMonster WordPress Plugin


2. Set your OptinMonster API Key

Select a package at OptinMonster to create your account and generate an API key.

Enter your API key in your site’s WordPress Admin > OptinMonster > Settings tab.


3. Install the “Exit Intent” Addon

Click the “Install Addon” button for the Exit Intent Addon in your site’s WordPress Admin > OptinMonster > Addons tab.


4. (optional) Install the Affiliates Add On for Paid Memberships Pro

If you want to track the membership checkouts generated by your new Optin, you can do so using the Lightweight Affiliate Add On for Paid Memberships Pro. Just follow the instructions on the add on documentation to install, activate, and set up an affiliate ID for your OptinMonster campaign.


5. Create Your Optin

  1. Click “Add New” under the OptinMonster > Optins tab.
  2. Choose the Theme and set up the custom Design (colors, custom CSS) for your Optin.
  3. Live edit the text of your Optin in the “preview” window. Don’t worry about adding any buttons or links in the space.
  4. Under Configuration, check the “Hide for Logged-in Users?” and “Enable Enable Exit Intent?” boxes. I kept our “Exit Intent Sensitivity” at 20 (the recommended default).
  5. Under Integration, select “Custom HTML Optin Form” for “Email provider”.
  6. Under Integration, set up your “button” link in the “Custom HTML Form Code”. Here’s the code I placed in my box:
    <a id="om-lightbox-target-optin-submit" href="https://www.paidmembershipspro.com/membership-checkout/?level=7&pa=OIM">Download for Free Now</a>

    The id=”om-lightbox-target-optin-submit” tells my button to inherit the selected “Design” submit button appearance/styling.

    The href=”https://www.paidmembershipspro.com/membership-checkout/?level=7&pa=OIM” tells my button to link to my membership checkout page for level ID 7 with the Affiliate ID “OIM” (this is the unique affiliate I set up for my Optin in step 4 above.

    Modify the code above for your unique membership checkout page URL (https protocol if the checkout is for a paid level), level ID, and affiliate ID.

  7. Under Output, make sure you check “Enable optin on site?” to turn on your new Optin. I load our Optin “globally” but you can configure additional settings for your Optin as desired.

And you’re off!

The Optin campaign is now active on your site. You’ll be able to track membership checkouts generated by your affiliate ID under the Memberships > Affiliates admin page. If you are not using the Affiliates add on, just use your Memberships > Reports page and filter by the level your Optin is driving traffic to. You’ll be able to track the membership checkouts and see what effect the new Optin is having on signups. Good luck!