This topic has 4 replies, 2 voices, and was last updated 8 years by Laura.

  • Author
  • #139636
     meltdown
    Participant

    I’m a bit confused about new member signups. I have only one membership level (a FREE membership), which I have created. When someone registers, I want them to be automatically subscribed to that membership level.

    As it is now, the new member is “registered” but is NOT registered to my one membership level. Instead, they are directed to a blank Membership Levels page (see attached image).

    How can they be automatically subscribed to my membership level?
    Thanks again

    Attachments:
    You must be logged in to view attached files.
    #139638
     meltdown
    Participant

    Using the following code found at this support thread new members are directed to a blank Membership Levels page (as pictured in the attached image). Why is the page blank if I have created a FREE membership level?

    COPY CODE
    add_action( 'template_redirect', 'my_membersip_restrict' );
     
    function my_membersip_restrict() {
        global $pmpro_pages, $post;
     
        if ( is_user_logged_in() && !pmpro_hasMembershipLevel() ) {
            if (isset($post->ID) && !in_array($post->ID, $pmpro_pages)) {
                wp_redirect( pmpro_url() );
            }
        }
    }

    Without that code they are “registered” but NOT registered to my one membership level. How can they just be automatically subscribed to my membership level?

    Thanks again

    #139759
     Laura
    Moderator

    Hello, this is the function you need to add in order to assign a specific membership level to a newly registered user. Add it into your sweetdate-child/functions.php

    COPY CODE
    
    add_action('user_register', 'kleo_pmpro_default_level');
    function kleo_pmpro_default_level($user_id) {
    	pmpro_changeMembershipLevel(1,$user_id);
    }
    

    Change the 1 for the membership level id#

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #139781
     meltdown
    Participant

    Beautiful! Thank you very much for your help 🙂

    #140046
     Laura
    Moderator

    Glad to help 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?