This topic has 4 replies, 4 voices, and was last updated 7 years by Radu.

  • Author
  • #166777
     samuelhatton
    Participant

    Ok. I have 3 membership types in paid membership pro that are all free. I want someone to chose one of the three when registering for the site. I’m currently using buddypress as user interface. I don’t need member listing or groups. I’ve never used paid memberships pro before. What is the best way to force user to chose member type on sign up, give them a dashboard to view account information?

    https://www.paidmembershipspro.com/apply-a-buddypress-member-type-on-membership-checkout-or-level-change/

    Is that applicable or more complicated than i need?

    #166799
     Kieran_SQ
    Moderator

    Hi @samuelhatton,

    I am going to assign this ticket to Radu who will be able to help you more with your question, they should be in touch soon.

    Thanks,

    Kieran.

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

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

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #167028
     Radu
    Moderator

    Hi,

    You can use the next solution by adding the next code to wp-content/themes/kleo-child/functions.php

    The code will allow users to register but immidiately after they finish registration users will be redirected and locked into the memebrship levels page until users buy or leave.

    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() );
            }
        }
    }
    
    

    The snippet will be pasted in wp-content/themes/kleo-child/functions.php

    NOTE : The Kleo Child Theme needs to be installed and activated.

    Cheers
    R.

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

    Hi @Radu

    I have used your code for the same purpose as outlined by @samuelhatton. Unfortunately the code interrupts the correct loading of the homepage. The head loads but not the content. When refreshing the page, the content loads successfully. I am using the code below in functions.php of the child theme to use a different homepage for users (buddypress activity) than for visitors.

    COPY CODE
    // set activity as homepage for logged in users
    function switch_homepage() {
        if ( is_user_logged_in() ) {
            $page = 6; // for logged in users
            update_option( 'page_on_front', $page );
            update_option( 'show_on_front', 'page' );
        } else {
            $page = 9517; // for logged out users
            update_option( 'page_on_front', $page );
            update_option( 'show_on_front', 'page' );
        }
    }
    add_action( 'init', 'switch_homepage' );

    Do you have any suggestions please? Thanks.

    #173415
     Radu
    Moderator

    Hi,

    Try to use theme_setup instead init or after_theme_setup it happens earlier than init, this may be a cause.

    So replace the next line

    add_action( ‘init’, ‘switch_homepage’ );

    with

    add_action( ‘theme_setup’, ‘switch_homepage’ );

    OR

    add_action( ‘after_setup_theme’, ‘switch_homepage’ );

    Or you can give a try to this plugin : https://wordpress.org/plugins/bp-profile-as-homepage/

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?