Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Andrew Lima

    (@andrewza)

    Hey there,

    Are you currently running a page builder on your theme?

    You can also go into the specific page you would like to restrict and select “Require Membership” on the right hand side under categories etc. and select what level you would require to view that page.

    There is also shortcode you may use within your page – [membership level] ..content.. [/membership]

    Let me know 🙂

    Thread Starter WorldsEndless

    (@worldsendless)

    I’m using a custom theme that was developed for my client. I’ve tried individual page restrictions but nothing seems to happen. I’m not sure if it would be related that making it a password protected page (out-of-the-box option) also doesn’t work.

    Thread Starter WorldsEndless

    (@worldsendless)

    Is there some hook required in a theme to make these things work?

    Thread Starter WorldsEndless

    (@worldsendless)

    I found the problem: the theme relies on ACF and doesn’t actually perform the_content(), which is necessary to make things work. What checks should I make to find out whether the user is valid per paid memberships pro?

    Thread Starter WorldsEndless

    (@worldsendless)

    I made the following from the pro filters, which does the checking:

    function membership_okay(){
    if (function_exists (“pmpro_membership_content_filter”)) {
    $hasaccess = pmpro_has_membership_access(NULL, NULL, true);
    if(is_array($hasaccess))
    {
    //returned an array to give us the membership level values
    $post_membership_levels_ids = $hasaccess[1];
    $post_membership_levels_names = $hasaccess[2];
    $hasaccess = $hasaccess[0];
    }
    return $hasaccess;
    }
    return true; // default to a true return if membership pro is not installed
    }

    Plugin Author Andrew Lima

    (@andrewza)

    Sorry I’ve taken a while to respond.

    I’m glad you’ve managed to create a function to do the checks for you.

    You may also use this in your page templates (this is an example from PMPro site) –

    <?php
    if(pmpro_hasMembershipLevel(array('1','2','Gold'))) //allow content to be shown for level ID 1, 2 and level name 'Gold'
    {
    ?>
    //Place your HTML or PHP code here if the user is in the required membership level
    ...
    <?php
    }
    ?>

    Hope this helps somewhat. You may also receive formal support from http://www.paidmembershipspro.com if you have a subscription. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to actually get it to work?’ is closed to new replies.