Another great WordPress plugin is Ultimate Member, an extension which adds a powerful membership control system to your site. Even in its bare form, it is teeming with useful options and features, but in case this is not enough there is a whole set of paid extensions for even more powerful set of tools for your site.
One thing is missing from Ultimate Member, though. While this plugin offers a wide variety of membership levels and content access customizations, you are not able to set up a paywall for certain areas or features on your site. For this purpose, even the authors of Ultimate Member suggest using a different plugin, Restrict Content Pro. Combined, these two will turn your website into a powerful paywall-enabled membership system.
Set up a paywall for Ultimate Member’s User Photo extension
Here I will provide a tip on how to customize one of the most useful Ultimate Member extensions, User Photos. This addon enables users to attach photos to their profile and display them in a wide variety of ways. By the way of integration between Ultimate Member and Restrict Content Pro there should be a way to limit the access to users’ photos in their profile pages, but no such option exists.
Here is how to do it using a simple yet effective method – editing of template files within child theme.
Ultimate Member User Photo template files are stored in /wp-content/plugins/um-gallery-pro/templates/um-gallery. For this example I will use content-carousel.php template.
Copy this file into your child theme folder, observing the following folder structure: /wp-content/themes/YOUR-CHILD-THEME/ultimate-member/templates/um-gallery/. Replace YOUR-CHILD-THEME with the name of the folder actually storing your child theme.
Note how /um-gallery is stored within /ultimate-member folder, instead of its own /um-gallery-pro folder, as is the case in the original plugin’s location.
In order to restrict access to User Photo extension display in frontend-only to paid members, edit the content-carousel.php file.
Right at the start of the file, make the following edit, adding this line before the template file’s HTML part:
<?php if ( rcp_user_has_paid_membership() ) : ?>
Line should be added after this section:
<?php global $photo; $user_id = um_profile_id(); $data = array(); $users = array(); ?>
and before this one:
<div id="um-gallery-carousel" class="owl-carousel um-gallery-carousel">
To wrap it up, we must close the if condition by adding this code to the very end of the file (add a line after the file’s final line of original code).
<?php endif; ?>
After this is done, only members with paid memberships will be able to see photo galleries on other member’s pages.
Leave A Comment