Improve the user experience (and increase signups) when using the Limit Post Views Add On

I recently helped two members in our support forums add some interesting and useful user-experience improvements to their sites. Both members are using the Limit Post Views Add On to give visitors or low-tier members the ability to view a limited number of restricted posts.

Continue reading to see how you can leverage this Add On to create a notification bar with a countdown of post views remaining or trigger the display of a popup using the popular Popup Maker plugin for WordPress.


About the Limit Post Views Add On

This Add On sets a cookie for each visitor to track their views. The plugin’s settings page allows you to set the number of visits per “term” for non-members as well as for each membership level. It will allow visitors or members limited access to view posts they do not already have access to view. Once the user’s view limit is reached, they are redirected to the assigned page (most people select the Membership Levels page).

View the Add On


Notification “Countdown” Bar

This nifty recipe will add a countdown, showing members just how many more post views they are allotted. Once the limit is reached, the user will be redirected as specific in the Add On’s settings.

The Code Recipe: Option 1

This code recipe requires a Plus Account or higher.

View Membership Options


Trigger a Popup when Limit is Reached

This next recipe integrates with the Popup Maker plugin available in the WordPress repository. Once the limit is reached, the user will be redirected to the specified page and the popup will trigger.

You can add any content you would like to this popup, perhaps even try using the [pmpro_signup] shortcode to give users a streamlined way become members. The only important piece for the Popup Maker settings is to set the “Conditions” to show only on the redirected page ID (usually the Membership Levels page).

Limit Post Views - Popup Maker Triggered

This code recipe requires a Plus Account or higher.

View Membership Options

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.

 

How to Hide the WordPress Dashboard (and build a better one) For Your Members

WordPress allows all user roles access to view an access-level appropriate version of the WordPress Dashboard. For most membership sites, access to this “backend” dashboard is often unnecessary and can be confusing for your users.

Below are some options for blocking this dashboard and redirecting users to the desired page on login.


  1. Redirect Members on Login

    The default login behavior for all WordPress roles is to redirect the user to the WordPress dashboard. Below are links to a few posts we have on customizations to send users to an alternate page, such as the referring URL or a page of your choice based on their level:

    • Redirecting Members on Login
      This recipe will show you how to redirect members to a specific page after logging in.
    • Redirect Members to Pages Based on Their Level
      This post covers how to redirect members to certain pages based on their membership level, allowing each level to have a unique member login destination.
    • Redirect Members to Referrer on Login
      The steps in this guide allow you to set a referrer in the Memberships > Advanced Settings for your “Message for Logged-out Users:”. This way, when a user clicks to “log in” to view the members-only content, they will be redirected back to that URL after login.

    Using these methods, the user will ONLY get into the dashboard when they would like to edit their user profile.

    Bonus tip #1: If you’re considering login redirection, you may also want to check out the Member Homepages Add On. This extension will redirect logged in members to a unique “homepage” based on their level. Any time a member attempts to access the actual site homepage, they will be sent to the appropriate page for them. I find this to be a great help when your site has to serve the dual purpose of marketing and “selling” membership along with being a well planned user experience for actual members.

    View the Add On
  2. Use the plugin Theme My Login

    This plugin handles redirection extremely well, which is why we didn’t include the functionality in Paid Memberships Pro itself. Theme My Login includes a setting to redirect users on login, as well as block dashboard access based on role. We have a longer post detailing the setup and additional features of this plugin here.

    Important: do not disable dashboard access without turning on the “Themed Profiles” module in Theme My Login. If you miss this step, users of the “subscriber” role will not be able to edit their profile.

  3. Use the plugin Hide the Admin Bar from Non-admins

    The plugins above don’t hide the admin bar, which you often want to hide as well. There are other plugins in the WP repo to hide the admin bar, but they either (a) hide it for admins as well or (b) require users to disable the bar via their settings. We whipped up our own plugin hide the admin bar for non-admins only.

    View the Plugin


Bonus Tip #2: Building a Member Dashboard

It’s great that you’re taking the time to consider the user experience and build a better login redirection process. But, what page are you going to actually redirect your users to?

I wrote a previous post on building a dashboard for your members. The post covers some recommendations to enhance your Membership Account page based on the type of site you’re running. Redirecting to the Membership Account page is a strong login experience as it provides detailed information about your member. And, if you take time to enhance this page with links to members content, the dashboard is an even more powerful landing page after login.

View the Guide on Member Dashboards

Let me know in the comments below if you have recommendations or requests related to login redirection—these are simply the most common ways we help users get their redirects in place.

Create and Manage Affiliates by Membership Level Using AffiliateWP

This code recipe creates affiliates or updates the status of existing affiliates based on their membership level when using AffiliateWP.

The affiliate is created after their membership level is changed to the appropriate level (in the recipe, this is level ID 1). When membership is cancelled or expires, the affiliate’s status is changed to “inactive”.

This page requires a PMPro Core Account or higher.

Already have an account? Login Now »

New to this site? Register Now »